Check these links:
soywiz
@soywiz
Best posts made by 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 -
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) }
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.
-
RE: rotation point when rotating a sprite
That's called "anchor" on KorGE. image.anchor(0.5, 0.5) should do the trick
-
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?
-
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
-
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.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
-
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 fromview.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. -
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.
-
RE: Networking examples?
There is a sample with websocket client/server here:
https://github.com/mmo-poc/mmo-poc -
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 -
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