Animation
Type class
An animation of a setting, returned by animate(). It can be paused, resumed, stopped or waited for.
More info: Animations
Sources
This information about Animation is provided for reference only and is not available through exported packages and thus should not be imported or used on its own.
Inheritance
Animation does not extend any other symbol.
Animation is not extended by any other symbol.
Properties
eventsType
EventDispatcherDefaultnew EventDispatcher()fromType
ValueThe value the animation starts from.
percentageType
TimeHow far the current loop has played, from
0to1, before easing.playingType
booleantruewhile the animation plays,falsewhen it is paused or stopped.stoppedType
booleantrueonce the animation has stopped. A stopped animation can't be played again.toType
ValueThe value the animation goes to.
Methods
constructor(animation:IStartAnimation,
from:Value,
to:Value,
duration:number,
easing:$ease.Easing,
loops:number,
startingTime:number|null)Returns
Animationpause()Returns
voidPauses the animation;
play()resumes it.play()Returns
voidResumes a paused animation.
stop()Returns
voidStops the animation, leaving the setting at its current value.
waitForStop()Returns
PromiseReturns a promise that resolves when the animation stops.
Events
Add event handlers to Animation object using its events.on() method. Read about adding event handlers.
stoppedParam { type:
"stopped", target:Animation}The animation stopped: it reached the end,
stop()was called, or the same setting was set, removed or animated again.