ClassAnimation & Atlases@public
FlxAnimationController
HaxeFlixel-style animation API backed by a deterministic FlxSprite clock.
ts
export declare class FlxAnimationControllerConstructors
ts
constructor(sprite: FlxSprite)Constructs a new instance of the FlxAnimationController class
| Parameter | Type | Description |
|---|---|---|
sprite | FlxSprite | - |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
curAnim | - | FlxAnim | null | - |
finished | - | boolean | - |
frameIndex | - | number | - |
frameName | - | string | null | - |
name | - | string | null | - |
numFrames | readonly | number | - |
onFinish | readonly | FlxSignal<string> | - |
onFrameChange | readonly | FlxSignal<FlxAnimationFrameEvent> | - |
onLoop | readonly | FlxSignal<string> | - |
paused | - | boolean | - |
timeScale | - | number | - |
Methods
add()
ts
add(name: string, frames: readonly number[], frameRate?: number, looped?: boolean, flipX?: boolean, flipY?: boolean): voidParameters:
| Parameter | Type | Description |
|---|---|---|
name | string | - |
frames | readonly number[] | - |
frameRate | number | - |
looped | boolean | - |
flipX | boolean | - |
flipY | boolean | - |
Returns: void
addByIndices()
ts
addByIndices(name: string, prefix: string, indices: readonly number[], postfix?: string, frameRate?: number, looped?: boolean, flipX?: boolean, flipY?: boolean): voidParameters:
| Parameter | Type | Description |
|---|---|---|
name | string | - |
prefix | string | - |
indices | readonly number[] | - |
postfix | string | - |
frameRate | number | - |
looped | boolean | - |
flipX | boolean | - |
flipY | boolean | - |
Returns: void
addByNames()
ts
addByNames(name: string, frameNames: readonly string[], frameRate?: number, looped?: boolean, flipX?: boolean, flipY?: boolean): voidParameters:
| Parameter | Type | Description |
|---|---|---|
name | string | - |
frameNames | readonly string[] | - |
frameRate | number | - |
looped | boolean | - |
flipX | boolean | - |
flipY | boolean | - |
Returns: void
addByPrefix()
ts
addByPrefix(name: string, prefix: string, frameRate?: number, looped?: boolean, flipX?: boolean, flipY?: boolean): voidParameters:
| Parameter | Type | Description |
|---|---|---|
name | string | - |
prefix | string | - |
frameRate | number | - |
looped | boolean | - |
flipX | boolean | - |
flipY | boolean | - |
Returns: void
append()
ts
append(name: string, frames: readonly number[]): voidParameters:
| Parameter | Type | Description |
|---|---|---|
name | string | - |
frames | readonly number[] | - |
Returns: void
destroy()
ts
destroy(): voidReturns: void
exists()
ts
exists(name: string): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
name | string | - |
Returns: boolean
finish()
ts
finish(): voidReturns: void
getAnimationList()
ts
getAnimationList(): FlxAnim[]Returns: FlxAnim[]
getNameList()
ts
getNameList(): string[]Returns: string[]
play()
ts
play(name: string, force?: boolean, reversed?: boolean, frame?: number): voidParameters:
| Parameter | Type | Description |
|---|---|---|
name | string | - |
force | boolean | - |
reversed | boolean | - |
frame | number | - |
Returns: void
randomFrame()
ts
randomFrame(): voidReturns: void
remove()
ts
remove(name: string): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
name | string | - |
Returns: boolean
rename()
ts
rename(oldName: string, newName: string): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
oldName | string | - |
newName | string | - |
Returns: boolean
stop()
ts
stop(): voidReturns: void