Skip to content
ClassAssets & Loading@public

FlxGraphic

A loaded or generated Pixi texture plus optional CPU-side pixel data.

ts
export declare class FlxGraphic

Constructors

ts
constructor(texture: Texture, options?: { ownsTexture?: boolean; pixels?: PixelBuffer | null; })

Constructs a new instance of the FlxGraphic class

ParameterTypeDescription
textureTexture-
options{ ownsTexture?: boolean; pixels?: PixelBuffer | null; }-

Properties

PropertyModifiersTypeDescription
cachedFrameCountreadonlynumberNumber of cached subtextures; useful for lifecycle diagnostics.
destroyedreadonlyboolean-
heightreadonlynumber-
pixelsreadonlyPixelBuffer | null-
texturereadonlyTexture-
widthreadonlynumber-

Methods

destroy()

ts
destroy(): void

Returns: void

frameTexture()

ts
frameTexture(frameIndex: number, frameWidth: number, frameHeight: number): Texture

Parameters:

ParameterTypeDescription
frameIndexnumber-
frameWidthnumber-
frameHeightnumber-

Returns: Texture

static fromPixels()

ts
static fromPixels(buffer: PixelBuffer, label?: string): FlxGraphic

Parameters:

ParameterTypeDescription
bufferPixelBuffer-
labelstring-

Returns: FlxGraphic

refresh()

ts
refresh(): void

Uploads mutations made to an owned CPU pixel buffer.

Returns: void

Released under the MIT License.