Navigation

    KorGE

    • Register
    • Login
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. soywiz
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    soywiz

    @soywiz

    5
    Reputation
    29
    Posts
    2
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    soywiz Follow
    administrators

    Best posts made by soywiz

    • RE: Cross platform coroutines?

      Check these links:

      • https://github.com/Kotlin/kotlinx.coroutines/issues/1147
      • http://blog.davidvassallo.me/2020/01/15/kotlin-coroutines-flow-parallel-processing/
      posted in General
      soywiz
      soywiz
    • RE: How to setup Android Studio with Korge

      Replied here: https://stackoverflow.com/questions/62636588/andorid-studio-korge-plugin-build-gradle/62638002#62638002

      posted in Support
      soywiz
      soywiz
    • RE: ECS and Shaders

      I think we discussed that on slack/discord already.
      No ECS provided by the engine, but some people talked about that stuff via chat, so not sure if someone will work on a ECS engine.
      Regarding to shaders: Shaders on KorGE are usually applied via filters, and created using a DSL for that. Please, check this link: https://github.com/korlibs/korge/blob/16aac42d6cf0e4eed19e088e12b73282661cf0f4/korge/src/commonMain/kotlin/com/soywiz/korge/view/filter/WaveFilter.kt#L31-L40

      posted in General
      soywiz
      soywiz
    • RE: How to add animated images in the game?

      It is not straightforward. But you can read all the frames of the GIF and great a SpriteAnimation. Thought with a fixed frameTime even if the GIF has different frame times. You could also implement the animation image changing yourself manually. In the case is it enough for you to have a fixed frame time:

      import com.soywiz.korge.*
      import com.soywiz.korge.view.*
      import com.soywiz.korim.bitmap.*
      import com.soywiz.korim.color.*
      import com.soywiz.korim.format.*
      import com.soywiz.korio.file.std.*
      
      suspend fun main() = Korge(width = 512, height = 512, bgcolor = Colors["#2b2b2b"]) {
      	val frames = resourcesVfs["ed3002fb3b703f38807ddb7da020169d.gif"].readBitmapImageData(GIF).frames
      	val frameTime = frames.first().time
      	val animation = SpriteAnimation(frames.map { it.bitmap.slice() }, frameTime)
      	val sprite = sprite(animation)
      	sprite.playAnimationLooped(animation)
      }
      
      posted in Support
      soywiz
      soywiz

    Latest posts made by soywiz

    • RE: High CPU usage when game is idle

      @Yuri-Volkov said in High CPU usage when game is idle:

      @soywiz Could you give us any clue on possible ways to control graphic engine energy / CPU consumption / maximum frame rate ?

      Can you create a feature request here?: https://github.com/korlibs/korge-next/issues/new

      This is not currently implemented, but could be implemented in a future version. Both not flipping the buffer and adjusting the fps.

      posted in General
      soywiz
      soywiz
    • RE: rotation point when rotating a sprite

      That's called "anchor" on KorGE. image.anchor(0.5, 0.5) should do the trick

      posted in Support
      soywiz
      soywiz
    • RE: Availability of korlibs libraries in npm registry

      May I ask you your use-case? Are you consuming them from a language other than Kotlin? Why can't you consume them from the official maven repositories?

      posted in Support
      soywiz
      soywiz
    • RE: Some questions regarding KorGe3D

      Unfortunately at this point, it is super experimental and more a proof of concept. @dhakehurst is making some contributions in korge-next related to KorGE3D: https://github.com/korlibs/korge-next/pull/23 but since that's a contribution I'm not sure how far that will reach on KorGE 2.0. The official plan is to work on the 3D part on KorGE 3.0 but since 2.0 is not released yet, it is a bit early for that

      posted in General
      soywiz
      soywiz
    • RE: Text input / Text input field?

      Right now, your best bet is to use the prompt method available on the gameWindow and the views instance.

      https://github.com/korlibs/korgw/blob/e6aebe811a6a7b9c252ca3d82a3480859c8df34f/korgw/src/commonMain/kotlin/com/soywiz/korgw/GameWindow.kt#L22-L30

      Acts like the javascript one: opens a dialog requesting a string.

      On KorGE 2.0 we might add support for native textfields over the game window

      posted in General
      soywiz
      soywiz
    • RE: Tweens of anything else but position/rotation...

      The same way as the other properties. Colors and angles are specially handled here: https://github.com/korlibs/korge/blob/16aac42d6cf0e4eed19e088e12b73282661cf0f4/korge/src/commonMain/kotlin/com/soywiz/korge/tween/tween.kt#L242-L248

      The way for doing that is:

      view.tween(view::colorMul[Colors.RED, Colors.BLUE])
      view.tween(view::rotation[180.degrees])
      

      Also note that in addition to views you can interpolate any other property just using the [...] syntax.
      The view from view.tween is the view that will register an updater, and as long as that view is on the stage, it will interpolate the properties on each frame.

      posted in General
      soywiz
      soywiz
    • RE: Networking examples?

      I'm afraid we don't have that yet. We don't have too much resources, so we are focusing on the code. But any contribution in that direction will be awesome.

      posted in General
      soywiz
      soywiz
    • RE: Networking examples?

      There is a sample with websocket client/server here:
      https://github.com/mmo-poc/mmo-poc

      posted in General
      soywiz
      soywiz
    • RE: Gamepad not recognised

      I think gamepad is not supported on windows JVM.
      Just created this issue for that: https://github.com/korlibs/korge-next/issues/29

      posted in Support
      soywiz
      soywiz
    • RE: Change/Hide Mouse Cursor?

      On HTML5, you cannot hide the cursor completely except when the mouse is down AFAIK.
      korge-next already has support for changing the cursor to a predefined one and hiding the cursor while the mouse is down.
      We can try to support custom cursor images. Just created this issue: https://github.com/korlibs/korge-next/issues/28

      posted in Support
      soywiz
      soywiz