Created
July 19, 2023 11:01
-
-
Save Bruce0203/54405188444d2d9fcd03def8fc312933 to your computer and use it in GitHub Desktop.
korge prototype
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```kotlin | |
import korlibs.time.* | |
import korlibs.korge.* | |
import korlibs.korge.scene.* | |
import korlibs.korge.tween.* | |
import korlibs.korge.view.* | |
import korlibs.image.color.* | |
import korlibs.image.format.* | |
import korlibs.io.file.std.* | |
import korlibs.korge.view.align.* | |
import korlibs.korge.view.animation.* | |
import korlibs.math.geom.* | |
import korlibs.math.interpolation.* | |
suspend fun main() = Korge(windowSize = Size(512, 512), backgroundColor = Colors.PAPAYAWHIP) { | |
val sceneContainer = sceneContainer() | |
sceneContainer.changeTo { MyScene() } | |
} | |
class MyScene : Scene() { | |
override suspend fun SContainer.sceneMain() { | |
val imageDataContainer = resourcesVfs["test.ase"].readImageDataContainer(ASE.toProps()) | |
val imageData = imageDataContainer.default | |
val animations = imageData.animations | |
val animation = imageData.defaultAnimation | |
val container = container() | |
val imageView = container.imageAnimationView(animation) { | |
smoothing = false | |
scale(15f) | |
centerOnStage() | |
} | |
} | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment