AnimationPlayer
Provides programmatic control of a reusable animation sequence,
built using the AnimationBuilder.build()
method which returns an AnimationFactory
, whose
create()
method instantiates and
initializes this interface.
interface AnimationPlayer {}
onDone
void
Provides a callback to invoke when the animation finishes.
() => void
The callback function.
void
onStart
void
Provides a callback to invoke when the animation starts.
() => void
The callback function.
void
onDestroy
void
Provides a callback to invoke after the animation is destroyed.
() => void
The callback function.
void
init
void
Initializes the animation.
void
hasStarted
boolean
Reports whether the animation has started.
boolean
play
void
Runs the animation, invoking the onStart()
callback.
void
pause
void
Pauses the animation.
void
restart
void
Restarts the paused animation.
void
finish
void
Ends the animation, invoking the onDone()
callback.
void
destroy
void
Destroys the animation, after invoking the beforeDestroy()
callback.
Calls the onDestroy()
callback when destruction is completed.
void
reset
void
Resets the animation to its initial state.
void
setPosition
void
Sets the position of the animation.
number
A fractional value, representing the progress through the animation.
void
getPosition
number
Reports the current position of the animation.
number
parentPlayer
AnimationPlayer | null
The parent of this player, if any.
totalTime
number
The total run time of the animation, in milliseconds.
beforeDestroy
(() => any) | undefined
Provides a callback to invoke before the animation is destroyed.