AnimationPlayer

Enables playback of Animation classes.

Author

Colton Daily

See also

Parameters

KeyFrameType

the type of key frame the Animation class is using.

Constructors

Link copied to clipboard

Functions

Link copied to clipboard
fun play(frame: KeyFrameType, frameTime: Duration = 50.milliseconds, numFrames: Int = 1)

Play a specified frame for a certain amount of frames.

fun play(animation: Animation<KeyFrameType>, times: Int = 1, queue: Boolean = false)

Play the specified animation an X number of times.

fun play(animation: Animation<KeyFrameType>, duration: Duration, queue: Boolean = false)

Play the specified animation for a duration.

Link copied to clipboard

Play the specified animation as a loop.

Link copied to clipboard

Play the specified animation one time.

Link copied to clipboard
fun registerState(anim: Animation<KeyFrameType>, priority: Int, loop: Boolean = true, reason: () -> Boolean = { true })

Priority is represented by the deepest. The deepest has top priority while the shallowest has lowest.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun restart()

Restarts the current running animation from the beginning. Is the same as invoking stop and then start.

Link copied to clipboard
fun resume()

Resumes any currently stopped animation. This only does something when an animation is stopped with stop.

Link copied to clipboard
fun start()

Starts any currently stopped animation from the beginning. This only does something when an animation is stopped with stop.

Link copied to clipboard
fun stop()

Stops any running animations. Resume the current animation with resume.

Link copied to clipboard
fun update(dt: Duration)

Runs any updates for any requested animation and grabs the next frame if so.

Properties

Link copied to clipboard

The current playing animations. Set this by using one of the play methods.

Link copied to clipboard

The index of the current frame

Link copied to clipboard
Link copied to clipboard
var onFrameChange: (Int) -> Unit? = null

Invoked when a frame is changed.

Link copied to clipboard
var overlapPlaying: Boolean = false
Link copied to clipboard

The total frames the currentAnimation has.

Link copied to clipboard

The total amount of frames played across all animations.

Inheritors

Link copied to clipboard