import Animation from 'WTF-Adventure/WTF-Adventure/client/entity/animation.js'Animation
Control animations for a sprite
Constructor Summary
| Public Constructor | ||
| public |
Default constructor |
|
Member Summary
| Public Members | ||
| public |
An internal counter for the callback |
|
| public |
The current frame in the animation |
|
| public |
End of counter calback function |
|
| public |
Height of 1 frame in the animation in pixels |
|
| public |
The last time the animation was updated |
|
| public |
Number of rames in the animation |
|
| public |
Sprite sheet |
|
| public |
Row of the animation in the sprite sheet |
|
| public |
The speed of the animation in miliseconds |
|
| public |
Width of 1 frame in the animation in pixels |
|
Method Summary
| Public Methods | ||
| public |
readyToAnimate(time: Number): Boolean Figure out whether or not this animation is ready to animate again |
|
| public |
reset() Reset the animation back to the beginning |
|
| public |
Set the counter for the callback, used for attack sequences |
|
| public |
Set the row the animation is in |
|
| public |
Set the speed of the animation |
|
| public |
tick(): Void Grab the next frame in the animation |
|
| public |
Update the animation over time by changing to the next frame |
|
Public Constructors
Public Members
Public Methods
public readyToAnimate(time: Number): Boolean source
Figure out whether or not this animation is ready to animate again
Params:
| Name | Type | Attribute | Description |
| time | Number | time in miliseconds |
public setCount(count: Number, onEndCount: Function) source
Set the counter for the callback, used for attack sequences
public setRow(row: Number) source
Set the row the animation is in
Params:
| Name | Type | Attribute | Description |
| row | Number | row in the sprite sheet |
Reference
Source
Test
