Contains data about a sprite animation.
0.1.0
.Constructor
new(name:String, frames:Array<Int>, reverse:Bool = false, defaultDuration:Int = 100)
Creates an nb.Sprite.AnimData
instance.
Parameters:
name | A name to identify the animation. |
---|---|
frames | The animation's frame indexes. |
reverse | Whether the animation should be played in reverse. |
defaultDuration | The default duration of the frames. |
Variables
framesDuration:Array<Int>
Contains the frame duration for each frame. frameDuration[4]
is the frame duration of the 4th frame.
onFrameEnd:(AnimData, Int) ‑> Int = null
A function that gets called at the end of every frame.
The first argument is the associated animation data, and the second argument the frame that is just stopping to get displayed. Returns the index of the next frame set to be displayed.
onFrameEnd
gets called before onFrameStart
.
onFrameStart:(AnimData, Int) ‑> Int = null
A function that gets called at the start of every frame.
The first argument is the associated animation data, and the second argument the frame that is just starting to get displayed. Returns the index of the next frame set to be displayed.
onFrameEnd
gets called before onFrameStart
.