Skip to content
ClassAnimation & Atlases@public

FlxFramesCollection

Ordered frame views shared by sprite animation and atlas workflows.

ts
export declare class FlxFramesCollection

Constructors

ts
constructor(frames?: readonly FlxFrame[])

Constructs a new instance of the FlxFramesCollection class

ParameterTypeDescription
framesreadonly FlxFrame[]-

Properties

PropertyModifiersTypeDescription
frames-FlxFrame[]-
numFramesreadonlynumber-

Methods

destroy()

ts
destroy(): void

Returns: void

static fromAtlas()

ts
static fromAtlas(frames: FlxAtlasFrameList): FlxFramesCollection

Parameters:

ParameterTypeDescription
framesFlxAtlasFrameList-

Returns: FlxFramesCollection

static fromGraphicGrid()

ts
static fromGraphicGrid(graphic: FlxGraphic, frameWidth: number, frameHeight: number, options?: FlxGridFramesOptions): FlxFramesCollection

Parameters:

ParameterTypeDescription
graphicFlxGraphic-
frameWidthnumber-
frameHeightnumber-
optionsFlxGridFramesOptions-

Returns: FlxFramesCollection

getByIndices()

ts
getByIndices(indices: readonly number[]): FlxFrame[]

Parameters:

ParameterTypeDescription
indicesreadonly number[]-

Returns: FlxFrame[]

getByName()

ts
getByName(name: string): FlxFrame

Parameters:

ParameterTypeDescription
namestring-

Returns: FlxFrame

getByNames()

ts
getByNames(names: readonly string[]): FlxFrame[]

Parameters:

ParameterTypeDescription
namesreadonly string[]-

Returns: FlxFrame[]

getByPrefix()

ts
getByPrefix(prefix: string): FlxFrame[]

Parameters:

ParameterTypeDescription
prefixstring-

Returns: FlxFrame[]

getFrame()

ts
getFrame(index: number): FlxFrame

Parameters:

ParameterTypeDescription
indexnumber-

Returns: FlxFrame

setNames()

ts
setNames(names: readonly (string | null)[]): void

Parameters:

ParameterTypeDescription
namesreadonly (string | null)[]-

Returns: void

Released under the MIT License.