commonMain.ru.casperix.spine.animation.KeyFrame.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spine-jvm Show documentation
Show all versions of spine-jvm Show documentation
Signals for all occasions
package ru.casperix.spine.animation
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import ru.casperix.spine.json.component.Curve
import ru.casperix.spine.json.component.LinearCurve
interface KeyFrame {
val time: Float
}
interface CurveKeyFrame : KeyFrame {
val curve: Curve
}
@Serializable
class RotateKeyFrame(
override val time: Float = 0f,
override val curve: Curve = LinearCurve,
/**
* Doc say "angle".
* But file and runtimes uses "value"
* 4.2.22
*/
@SerialName("value")
val angle: Float = 0f,
) : CurveKeyFrame
@Serializable
class TranslateKeyFrame(
override val time: Float = 0f,
override val curve: Curve = LinearCurve,
val x: Float = 0f,
val y: Float = 0f,
) : CurveKeyFrame
@Serializable
class ScaleKeyFrame(
override val time: Float = 0f,
override val curve: Curve = LinearCurve,
val x: Float = 1f,
val y: Float = 1f,
) : CurveKeyFrame
@Serializable
class ShearKeyFrame(
override val time: Float = 0f,
override val curve: Curve = LinearCurve,
val x: Float = 0f,
val y: Float = 0f,
) : CurveKeyFrame