Just a helper structure for the FlxSprite
animation system.
Constructor
new(Parent:FlxAnimationController, Name:String, Frames:Array<Int>, FrameRate:Float = 0, Looped:Bool = true, FlipX:Bool = false, FlipY:Bool = false)
Parameters:
Name | What this animation should be called (e.g. |
---|---|
Frames | An array of numbers indicating what frames to play in what order (e.g. |
FrameRate | The speed in frames per second that the animation should play at (e.g. |
Looped | Whether or not the animation is looped or just plays once. |
FlipX | Whether or not the frames of this animation are horizontally flipped. |
FlipY | Whether or not the frames of this animation are vertically flipped. |
Variables
curFrame:Int = 0
Keeps track of the current frame of animation. This is NOT an index into the tile sheet, but the frame number in the animation object.
Methods
play(Force:Bool = false, Reversed:Bool = false, Frame:Int = 0):Void
Starts this animation playback.
Parameters:
Force | Whether to force this animation to restart. |
---|---|
Reversed | Whether to play animation backwards or not. |
Frame | The frame number in this animation you want to start from ( |