From 39eede0086b9b54e3a4d8703a6acc633e726d710 Mon Sep 17 00:00:00 2001 From: Colston Date: Mon, 25 Mar 2024 02:03:20 +0800 Subject: [PATCH] added ease in animator to player animation --- src/commonMain/kotlin/main.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/commonMain/kotlin/main.kt b/src/commonMain/kotlin/main.kt index ebeebc1..c95b293 100644 --- a/src/commonMain/kotlin/main.kt +++ b/src/commonMain/kotlin/main.kt @@ -5,6 +5,7 @@ import korlibs.image.color.* import korlibs.image.format.* import korlibs.io.file.std.* import korlibs.korge.* +import korlibs.korge.animate.* import korlibs.korge.dragonbones.* import korlibs.korge.input.* import korlibs.korge.mascots.* @@ -145,7 +146,14 @@ class MyScene : Scene() { fun setState(name: String, time: TimeSpan) { if (playerState != name) { playerState = name - player.animation = name + + animator { + tween(time = time, easing = Easing.EASE_IN) + block { + player.animation = name + } + } + player.play() } }