Skip to content
ClassGame Objects & Sprites@public

FlxBackdrop

Infinitely repeating, independently scrolling texture region.

The authoritative state stays renderer-neutral while the Pixi adapter uses one TilingSprite, avoiding duplicate gameplay objects and wrap seams.

ts
export declare class FlxBackdrop extends FlxSprite

Constructors

ts
constructor(source?: FlxGraphic | Texture | null, x?: number, y?: number, width?: number, height?: number)

Constructs a new instance of the FlxBackdrop class

ParameterTypeDescription
sourceFlxGraphic | Texture | null-
xnumber-
ynumber-
widthnumber-
heightnumber-

Properties

PropertyModifiersTypeDescription
repeatX-booleanRepeat the texture horizontally.
repeatY-booleanRepeat the texture vertically.
scrollVelocityreadonlyFlxPointDeterministic tile-position change in logical pixels per second.
tileAngle-numberRotation applied to each tile, in degrees.
tilePositionreadonlyFlxPointTexture offset in logical pixels.
tileScalereadonlyFlxPointScale applied to each repeated tile without resizing the visible region.

Methods

createRenderHandle()

ts
createRenderHandle(): FlxBackdropRenderHandle

Returns: FlxBackdropRenderHandle

loadBackdropFrame()

ts
loadBackdropFrame(atlas: FlxAtlas, name: string, width?: number, height?: number): this

Load one named atlas frame as the repeating texture.

Parameters:

ParameterTypeDescription
atlasFlxAtlas-
namestring-
widthnumber-
heightnumber-

Returns: this

loadBackdropGraphic()

ts
loadBackdropGraphic(source: FlxGraphic | Texture, width?: number, height?: number): this

Load a texture and optionally set the visible tiling region.

Parameters:

ParameterTypeDescription
sourceFlxGraphic | Texture-
widthnumber-
heightnumber-

Returns: this

loadGraphic()

ts
loadGraphic(source: FlxGraphic | Texture, animated?: boolean, reverse?: boolean, width?: number, height?: number, unique?: boolean): this

Parameters:

ParameterTypeDescription
sourceFlxGraphic | Texture-
animatedboolean-
reverseboolean-
widthnumber-
heightnumber-
uniqueboolean-

Returns: this

onScreen()

ts
onScreen(camera?: FlxCameraLike): boolean

Parameters:

ParameterTypeDescription
cameraFlxCameraLike-

Returns: boolean

preUpdate()

ts
preUpdate(): void

Returns: void

resize()

ts
resize(width: number, height: number): this

Resize the visible tiling region without scaling its repeated texture.

Parameters:

ParameterTypeDescription
widthnumber-
heightnumber-

Returns: this

update()

ts
update(): void

Returns: void

Released under the MIT License.