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.
Deprecation warning
onDone
voidProvides a callback to invoke when the animation finishes.
() => voidThe callback function.
voidonStart
voidProvides a callback to invoke when the animation starts.
() => voidThe callback function.
voidonDestroy
voidProvides a callback to invoke after the animation is destroyed.
() => voidThe callback function.
voidinit
voidInitializes the animation.
voidhasStarted
booleanReports whether the animation has started.
booleanplay
voidRuns the animation, invoking the onStart() callback.
voidpause
voidPauses the animation.
voidrestart
voidRestarts the paused animation.
voidfinish
voidEnds the animation, invoking the onDone() callback.
voiddestroy
voidDestroys the animation, after invoking the beforeDestroy() callback.
Calls the onDestroy() callback when destruction is completed.
voidreset
voidResets the animation to its initial state.
voidsetPosition
voidSets the position of the animation.
numberA fractional value, representing the progress through the animation.
voidgetPosition
numberReports the current position of the animation.
numberparentPlayer
AnimationPlayer | nullThe parent of this player, if any.
totalTime
numberThe total run time of the animation, in milliseconds.
beforeDestroy
(() => any) | undefinedProvides a callback to invoke before the animation is destroyed.