Skip to main content
Version: Phaser v4.0.0

TexturerTileSprite

A RenderNode which handles texturing for a single TileSprite GameObject.

Unlike a standard sprite texturer, this node computes a UV transformation matrix that accounts for the TileSprite's tile position, tile scale, and tile rotation, allowing the texture to scroll, scale, and rotate independently of the GameObject's own transform. It stores the resulting frame data and UV matrix so they can be consumed by a subsequent render node before this node is reused.

Constructor

new TexturerTileSprite(manager)

Parameters

nametypeoptionaldescription
managerPhaser.Renderer.WebGL.RenderNodes.RenderNodeManagerNoThe manager that owns this RenderNode.

Scope: static

Extends

Phaser.Renderer.WebGL.RenderNodes.RenderNode

Source: src/renderer/webgl/renderNodes/texturer/TexturerTileSprite.js#L11
Since: 4.0.0

Inherited Members

From Phaser.Renderer.WebGL.RenderNodes.RenderNode:


Public Members

frame

frame: Phaser.Textures.Frame

Description:

The frame data of the GameObject being rendered.

Source: src/renderer/webgl/renderNodes/texturer/TexturerTileSprite.js#L36
Since: 4.0.0


uvMatrix

uvMatrix: Phaser.GameObjects.Components.TransformMatrix

Description:

The matrix used internally to compute UV coordinates.

Source: src/renderer/webgl/renderNodes/texturer/TexturerTileSprite.js#L45
Since: 4.0.0


Inherited Methods

From Phaser.Renderer.WebGL.RenderNodes.RenderNode:


Public Methods

run

<instance> run(drawingContext, gameObject, [element])

Description:

Populates this RenderNode with texture data for the given TileSprite GameObject. Stores the frame and computes the UV transformation matrix by applying the tile position, tile scale, and tile rotation in TSR order, then mapping the result to the GameObject's display area. If the GameObject is cropped, the crop UVs are updated first to account for any flip state change. The stored values must be consumed before this node is reused.

Parameters:

nametypeoptionaldescription
drawingContextPhaser.Renderer.WebGL.DrawingContextNoThe current drawing context.
gameObjectPhaser.GameObjects.ImageNoThe GameObject being rendered.
elementobjectYesThe specific element within the game object. This is used for objects that consist of multiple quads. It is unused here.

Overrides: Phaser.Renderer.WebGL.RenderNodes.RenderNode#run

Source: src/renderer/webgl/renderNodes/texturer/TexturerTileSprite.js#L55
Since: 4.0.0