
Implement an animator object that change values over time using Linear Interpolation. Usage example: (new Animator(sprite)).from({‘position.x’: 0}).to({‘position.x’: 100}).duration(1).play();
Kind: global class
BooleanAnimatorAnimatorAnimatorAnimatorAnimatorAnimatorAnimatorAnimatorAnimatorCreate the animator.
| Param | Type | Description |
|---|---|---|
| target | \* |
Any object you want to animate. |
Speed factor to multiply with delta every time this animator updates.
Kind: instance property of Animator
BooleanGet if this animator finished.
Kind: instance property of Animator
Returns: Boolean - True if animator finished.
Update this animator with a given delta time.
Kind: instance method of Animator
| Param | Type | Description |
|---|---|---|
| delta | Number |
Delta time to progress this animator by. |
AnimatorSet a method to run when animation ends.
Kind: instance method of Animator
Returns: Animator - this.
| Param | Type | Description |
|---|---|---|
| callback | function |
Callback to invoke when done. |
AnimatorSet smooth damp. If true, lerping will go slower as the animation reach its ending.
Kind: instance method of Animator
Returns: Animator - this.
| Param | Type | Description |
|---|---|---|
| enable | Boolean |
set smooth damp mode. |
AnimatorSet if the animator should repeat itself.
Kind: instance method of Animator
Returns: Animator - this.
| Param | Type | Description |
|---|---|---|
| enable | Boolean | Number |
false to disable repeating, true for endless repeats, or a number for limited number of repeats. |
| reverseAnimation | Boolean |
if true, it will reverse animation to repeat it instead of just “jumping” back to starting state. |
AnimatorIf true, will reverse animation back to start values after done.
This is equivalent to calling repeats(1, true).
Kind: instance method of Animator
Returns: Animator - this.
AnimatorSet ‘from’ values. You don’t have to provide ‘from’ values, when a value is not set the animator will just take whatever was set in target when first update is called.
Kind: instance method of Animator
Returns: Animator - this.
| Param | Type | Description |
|---|---|---|
| values | \* |
Values to set as ‘from’ values. Key = property name in target (can contain dots for nested), value = value to start animation from. |
AnimatorSet ‘to’ values, ie the result when animation ends.
Kind: instance method of Animator
Returns: Animator - this.
| Param | Type | Description |
|---|---|---|
| values | \* |
Values to set as ‘to’ values. Key = property name in target (can contain dots for nested), value = value to start animation from. |
Flip between the ‘from’ and the ‘to’ states.
Kind: instance method of Animator
AnimatorMake this Animator update automatically with the gameTime delta time. Note: this will change the speedFactor property.
Kind: instance method of Animator
Returns: Animator - this.
| Param | Type | Description |
|---|---|---|
| seconds | Number |
Animator duration time in seconds. |
AnimatorReset animator progress.
Kind: instance method of Animator
Returns: Animator - this.
AnimatorMake this Animator update automatically with the gameTime delta time, until its done.