Constructor
new(parent:FlxAnimate, ?coolParsed:AnimAtlas)
Creates a new FlxAnim instance.
Parameters:
parent | The |
|---|---|
coolParsed | The Animation file. |
Variables
metadata:FlxMetaData
Metadata. shortcut to display the name of the document and the default framerate.
onComplete:FlxSignal = new FlxSignal()
A signal dispatched when the animation's over, when the current frame is equal to the current symbol's length.
onFrame:FlxTypedSignal<Int ‑> Void> = new FlxTypedSignal()
A signal dispatched when the animation advances one frame.
Parameters:
frame | The current frame number. |
|---|
symbolDictionary:Map<String, FlxSymbol>
A map containing all FlxSymbol instances, whether prefabricated or not.
symbolType:SymbolT
The type of the current symbol. This can be of three types:
MovieClip-
Graphic- `Button`
Methods
addByAnimIndices(Name:String, Indices:Array<Int>, FrameRate:Float = 0):Void
Creates an animation using the indices, looking as a reference the main animation of the texture atlas.
Parameters:
Name | The name of the animation you're creating |
|---|---|
Indices | The indices you're gonna be using for the animation, like |
FrameRate | the framerate of the animation. |
addByCustomTimeline(Name:String, Timeline:FlxTimeline, FrameRate:Float = 0, Looped:Bool = true):Void
This adds a new animation by adding a custom timeline, obviously taking as a reference the timeline syntax! WARNING: I, CheemsAndFriends, do NOT recommend this unless you're using an extern json file to do this! if you wanna make a custom symbol to play around and is separated from the texture atlas, go ahead! but if you wanna just make a new symbol, just do it in Flash directly
Parameters:
Name | The name of the new Symbol. |
|---|---|
Timeline | The timeline which will have the symbol. |
FrameRate | The framerate it'll go, by default is 30. |
addByFrameLabel(Name:String, FrameLabel:String, FrameRate:Float = 0, Looped:Bool = true, X:Float = 0, Y:Float = 0):Void
Creates an animation based on a frame label's starting frame and duration.0
Parameters:
Name | The name of the animation to add. |
|---|---|
FrameLabel | The frame label to use as the starting frame. |
FrameRate | The framerate of the animation to use. |
Looped | Whether the animation should loop or not. |
X | A x offset to apply to the animation. |
Y | A y offset to apply to the animation. |
addBySymbol(Name:String, SymbolName:String, FrameRate:Float = 0, Looped:Bool = true, X:Float = 0, Y:Float = 0):Void
Creates an animation using an already made symbol from a texture atlas
Parameters:
Name | The name of the animation |
|---|---|
SymbolName | the name of the symbol you're looking. if you have two symbols beginning by the same name, use |
X | the x axis of the animation. |
Y | the y axis of the animation. |
FrameRate | the framerate of the animation. |
addBySymbolIndices(Name:String, SymbolName:String, Indices:Array<Int>, FrameRate:Float = 0, Looped:Bool = true, X:Float = 0, Y:Float = 0):Void
addCallbackTo(label:String, callback:() ‑> Void):Bool
Links a callback into a label.
Parameters:
label | the name of the label. |
|---|---|
callback | the callback you're going to add |
getNextToFrameLabel(name:String):Null<String>
Checks the next frame label name you're looking for.
WARNING: DO NOT confuse with anim.curSymbol.getNextToFrameLabel!!
Parameters:
name | the name of the frame label. |
|---|
Returns:
A String. WARNING: it can be null
goToFrameLabel(name:String, ?layer:EitherType<Int, String>):Void
Redirects the frame into a frame with a frame label of that type.
Parameters:
name | the name of the label. |
|---|
play(Name:String = "", Force:Bool = false, Reverse:Bool = false, Frame:Int = 0):Void
Plays an animation.
Parameters:
Name | The name of an animation or an |
|---|---|
Force | Whether it should Force a reset to the animation before playing. |
Reverse | If the animation will go on reverse or not. |
Frame | To which frame it will begin. |