new Animation(config)
Creates an animation.
Possible Configuration
- easing : string
- duration : number (milliseconds)
- target : object
- properties : object
Parameters:
| Name | Type | Description |
|---|---|---|
config |
config | Configuration of the animation. |
Methods
-
observeAtTick(ratio, callback)
-
Allows observing on a particular percentage ratio tick.
Parameters:
Name Type Description rationumber The ratio of completeness between 0-1.
callbackfunction The function notified at the given ratio.
Returns:
- Type
- Observer
-
play()
-
Plays the animation forward.
Returns:
- Type
- Animation
-
playToEndAsync( [startAt])
-
Play the animation to the end.
Parameters:
Name Type Argument Description startAtnumber <optional>
What ratio of completeness to start at. (0-1)
Returns:
- Type
- Promise
-
playToPercentageAsync(percentage)
-
Play to the given percentage.
Parameters:
Name Type Description percentagenumber The percentage to play to.
Returns:
- Type
- Promise
-
stop()
-
Stops the animation.
Returns:
- Type
- Animation