Displays an animated sequence of bitmap Tiles on the screen.
Anim does not provide animation sequence management and it's up to user on how to implement it.
Another limitation is framerate. Anim runs at a fixed framerate dictated by
Switching animations can be done through
The current frame the animation is currently playing. Always in
Std.int(anim.currentFrame) in order to obtain current frame index.
Fractional value represents the progress of current frame and increases according to
Setting frame to a negative value will wrap it around from the end of the animation. Setting negative value smaller than
-frames.length lead to undefined behavior.
Setting frame to a value greater than
frames.length would cause to wrap around.
fading:Bool = false
When enabled, fading will draw two consecutive frames with alpha transition between them instead of directly switching from one to another when it reaches the next frame. This can be used to have smoother animation on some effects.
The current animation, as a list of tile frames to display. If the frames are empty or if a tile is frames is null, a pink 5x5 bitmap will be displayed instead.
loop:Bool = true
Disabling loop will stop the animation at the last frame.
pause:Bool = false
Setting pause will suspend the animation, preventing automatic accumulation of
Anim.currentFrame over time.
The speed (in frames per second) at which the animation is playing.
Settings speed to a negative value is not supported and leads to undefined behavior.
Sent each time the animation reaches past the last frame.
loop is enabled, callback is sent every time the animation loops.
During the call,
currentFrame is already wrapped around and represent new frame position so it's safe to modify it.
loop is disabled, callback is sent only once when the animation reaches
currentFrame == frames.length.
During the call,
currentFrame is always equals to