Constructor

new(parent:FlxAnimate, ?coolParsed:AnimAtlas)

Creates a new FlxAnim instance.

Parameters:

parent

The FlxAnimate instance it's gonna control.

coolParsed

The Animation file.

Variables

curFrame:Int

The frame the animation is currently.

curInstance:FlxElement

The current instance the animation is playing.

read onlycurSymbol:FlxSymbol

The current symbol the instance is taking as a reference.

read onlyfinished:Bool

Whether the animation has finished or not.

framerate:Float

The framerate of the current animation.

read onlyisPlaying:Bool

When ever the animation is playing.

read onlylength:Int

The amount of frames that are in the current symbol.

@:value(null)library:FlxSymbolDictionary = null

loopType:Loop

The looping method of curSymbol.

Made public since 4.0.0

metadata:FlxMetaData

Metadata. shortcut to display the name of the document and the default framerate.

@:value(new FlxSignal())onComplete:FlxSignal = new FlxSignal()

A signal dispatched when the animation's over, when the current frame is equal to the current symbol's length.

@:value(new FlxTypedSignal())onFrame:FlxTypedSignal<Int ‑> Void> = new FlxTypedSignal()

A signal dispatched when the animation advances one frame.

Parameters:

frame

The current frame number.

reversed:Bool

a reverse option where the animation plays backwards or not.

stageInstance:FlxElement

The Instance the texture atlas was exported when it was on stage.

@:value(false)swfRender:Bool = false

Checks whether MovieClips should move or not.

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:

@:value(1.0)timeScale:Float = 1.0

How fast or slow the symbols are going to go. Default value is 1.0

Available since

4.0.0

.

Methods

@:value({ FrameRate : 0 })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 [0,1,2].

FrameRate

the framerate of the animation.

@:value({ Looped : true, FrameRate : 0 })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.

@:value({ Y : 0, X : 0, Looped : true, FrameRate : 0 })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.

@:value({ Y : 0, X : 0, Looped : true, FrameRate : 0 })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 \ at the end to differ one symbol from another

X

the x axis of the animation.

Y

the y axis of the animation.

FrameRate

the framerate of the animation.

@:value({ Y : 0, X : 0, Looped : true, FrameRate : 0 })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

@:value({ frame : null })getByInstance(instance:String, ?frame:Int, ?layer:EitherType<String, Int>):Null<FlxSymbol>

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.

pause():Void

Pauses the current animation.

@:value({ Frame : 0, Reverse : false, Force : false, Name : "" })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 FlxSymbol

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.

@:value({ Frame : 0, Reverse : false, Force : false })playElement(element:FlxElement, Force:Bool = false, Reverse:Bool = false, Frame:Int = 0):Void

removeCallbackFrom(label:String, callback:() ‑> Void):Bool

resume():Void

Resumes the current animation.

stop():Void

stops the current animation.

update(elapsed:Float):Void