Skip to content
ClassAnimation & Atlases@public

FlxAnimationController

HaxeFlixel-style animation API backed by a deterministic FlxSprite clock.

ts
export declare class FlxAnimationController

Constructors

ts
constructor(sprite: FlxSprite)

Constructs a new instance of the FlxAnimationController class

ParameterTypeDescription
spriteFlxSprite-

Properties

PropertyModifiersTypeDescription
curAnim-FlxAnim | null-
finished-boolean-
frameIndex-number-
frameName-string | null-
name-string | null-
numFramesreadonlynumber-
onFinishreadonlyFlxSignal<string>-
onFrameChangereadonlyFlxSignal<FlxAnimationFrameEvent>-
onLoopreadonlyFlxSignal<string>-
paused-boolean-
timeScale-number-

Methods

add()

ts
add(name: string, frames: readonly number[], frameRate?: number, looped?: boolean, flipX?: boolean, flipY?: boolean): void

Parameters:

ParameterTypeDescription
namestring-
framesreadonly number[]-
frameRatenumber-
loopedboolean-
flipXboolean-
flipYboolean-

Returns: void

addByIndices()

ts
addByIndices(name: string, prefix: string, indices: readonly number[], postfix?: string, frameRate?: number, looped?: boolean, flipX?: boolean, flipY?: boolean): void

Parameters:

ParameterTypeDescription
namestring-
prefixstring-
indicesreadonly number[]-
postfixstring-
frameRatenumber-
loopedboolean-
flipXboolean-
flipYboolean-

Returns: void

addByNames()

ts
addByNames(name: string, frameNames: readonly string[], frameRate?: number, looped?: boolean, flipX?: boolean, flipY?: boolean): void

Parameters:

ParameterTypeDescription
namestring-
frameNamesreadonly string[]-
frameRatenumber-
loopedboolean-
flipXboolean-
flipYboolean-

Returns: void

addByPrefix()

ts
addByPrefix(name: string, prefix: string, frameRate?: number, looped?: boolean, flipX?: boolean, flipY?: boolean): void

Parameters:

ParameterTypeDescription
namestring-
prefixstring-
frameRatenumber-
loopedboolean-
flipXboolean-
flipYboolean-

Returns: void

append()

ts
append(name: string, frames: readonly number[]): void

Parameters:

ParameterTypeDescription
namestring-
framesreadonly number[]-

Returns: void

destroy()

ts
destroy(): void

Returns: void

exists()

ts
exists(name: string): boolean

Parameters:

ParameterTypeDescription
namestring-

Returns: boolean

finish()

ts
finish(): void

Returns: void

getAnimationList()

ts
getAnimationList(): FlxAnim[]

Returns: FlxAnim[]

getNameList()

ts
getNameList(): string[]

Returns: string[]

play()

ts
play(name: string, force?: boolean, reversed?: boolean, frame?: number): void

Parameters:

ParameterTypeDescription
namestring-
forceboolean-
reversedboolean-
framenumber-

Returns: void

randomFrame()

ts
randomFrame(): void

Returns: void

remove()

ts
remove(name: string): boolean

Parameters:

ParameterTypeDescription
namestring-

Returns: boolean

rename()

ts
rename(oldName: string, newName: string): boolean

Parameters:

ParameterTypeDescription
oldNamestring-
newNamestring-

Returns: boolean

stop()

ts
stop(): void

Returns: void

Released under the MIT License.