import Animation from '@mobilizing/library/js/Mobilizing/misc/Animation.js'
Animation
Extends:
The Animation class provides a simple way to tween object properties
Example:
//TODO
Constructor Summary
Public Constructor | ||
public | constructor(params: Object) |
Member Summary
Public Members | ||
public | delay: * | |
public | duration: * | |
public | easing: * | |
public | from: * | |
public | onFinish: * | |
public | onRestart: * | |
public | onResume: * | |
public | onStart: * | |
public | onStop: * | |
public | onUpdate: * | |
public | repeat: * | |
public | target: * | |
public | to: * | |
public | yoyo: * |
Private Members | ||
private | ||
private | ||
private | _time: * | |
private |
Method Summary
Public Methods | ||
public | chain(animation: *) Chain another animation once this one is finished | |
public | play() Play the animation | |
public | resume() Resume the animation | |
public | rewind() Rewind the animation back to its starting values | |
public | setup() Setup | |
public | stop() Stop the animation | |
public | update(time: *) Update the properties according to the elapsed time |
Public Constructors
public constructor(params: Object) source
Params:
Name | Type | Attribute | Description |
params | Object | The parameters object | |
params.target | Object | The object whose propoerties are to be animated | |
params.from | Object |
| An object indicating the start values of the properties to animate, defaults to the values of the target |
params.to | Object | An object indicating the finish values of the properties to animate | |
params.duration | Number | The animation duration in milliseconds | |
params.easing | Function |
| An easing function to use |
params.repeat | Number |
| The number of times the animation should be repeated, set to Infinity to repeat indefinately |
params.yoyo | Boolean |
| If set to true and repeat is greater than 1, the animation will play in reverse once it reached the end |
params.delay | Number |
| The number of milliseconds to wait for before starting the animation |
params.time | Time |
| The Time instance to use for this Animation Component |
params.onStart | Function |
| A callback to be called when the animation starts |
params.onUpdate | Function |
| A callback to be called each time the animation is updated |
params.onRestart | Function |
| A callback to be called each time the animation is repeated once it reached the end if repeat is greater than 1 |
params.onStop | Function |
| A callback to be called when the animation is stopped |
params.onResume | Function |
| A callback to be called when the animation is resumed |
params.onFinish | Function |
| A callback to be called when the animation reaches the end and no repetition is pending |
Public Members
public delay: * source
public duration: * source
public easing: * source
public from: * source
public onFinish: * source
public onRestart: * source
public onResume: * source
public onStart: * source
public onStop: * source
public onUpdate: * source
public repeat: * source
public target: * source
public to: * source
public yoyo: * source
Private Members
private _time: * source
Public Methods
public chain(animation: *) source
Chain another animation once this one is finished
Params:
Name | Type | Attribute | Description |
animation | * |
public play() source
Play the animation
public resume() source
Resume the animation
public rewind() source
Rewind the animation back to its starting values
public setup() source
Setup
public stop() source
Stop the animation
public update(time: *) source
Update the properties according to the elapsed time
Params:
Name | Type | Attribute | Description |
time | * |