Skip to content

Instantly share code, notes, and snippets.

@Bruce0203
Created July 19, 2023 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bruce0203/54405188444d2d9fcd03def8fc312933 to your computer and use it in GitHub Desktop.
Save Bruce0203/54405188444d2d9fcd03def8fc312933 to your computer and use it in GitHub Desktop.
korge prototype
```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