Constructor
new CanvasAnimation()
Members
animations :Object.<string, {fn: function(), context: PIXI.Container, resolve: function()}>
Track an object of active animations by name, context, and function This allows a currently playing animation to be referenced and terminated
Type:
- Object.<string, {fn: function(), context: PIXI.Container, resolve: function()}>
Methods
(async, static) animateLinear(attributes, options) → {Promise}
Apply a linear animation from the current value of some attribute to a new value Resolve a Promise once the animation has concluded and the attributes have reached their new target
Example
let animation = [
{
parent: token,
attribute: x,
to: 1000
},
{
parent: token,
attribute: y,
to: 2000
}
];
CanvasAnimation.animateLinear(attributes, {duration:500, ontick: console.log("ticking")});
Parameters:
Name | Type | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
attributes |
Array.<object> | An array of attributes to animate. Structure of the Array is shown in the example |
|||||||||||||||||||||||||
options |
object | Additional options which customize the animation Properties
|
Returns:
A Promise which resolves once the linear animation has concluded
- Type
- Promise
(static) terminateAnimation(name)
If an animation using a certain name already exists, terminate it
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The animation name to terminate |