TransformerTileSprite
A RenderNode that computes and stores the world-space transformation data required to render a TileSprite GameObject.
This class extends TransformerImage with one key difference: whereas TransformerImage derives the quad dimensions from the texture frame, TransformerTileSprite reads them directly from the GameObject's width and height properties. This is necessary because a TileSprite can have an arbitrary size that is independent of its underlying tile texture.
During its run call, the node builds a combined camera-and-sprite transform matrix (accounting for scroll factors, an optional parent matrix, rotation, scale, and flip), projects the GameObject's bounding quad into screen space, and optionally rounds the resulting vertices for crisp pixel-aligned rendering. The resulting quad coordinates are stored on this.quad for use by downstream render nodes (e.g. texturer and batcher nodes) in the same render pass.
Constructor
new TransformerTileSprite(manager, [config])
Parameters
| name | type | optional | description |
|---|---|---|---|
| manager | Phaser.Renderer.WebGL.RenderNodes.RenderNodeManager | No | The manager that owns this RenderNode. |
| config | object | Yes | The configuration object for this RenderNode. |
Scope: static
Extends
Source: src/renderer/webgl/renderNodes/transformer/TransformerTileSprite.js#L10
Since: 4.0.0
Inherited Methods
From Phaser.Renderer.WebGL.RenderNodes.RenderNode:
Public Methods
run
<instance> run(drawingContext, gameObject, [texturerNode], [parentMatrix], [element])
Description:
Computes the screen-space quad for a TileSprite GameObject and stores it in this.quad for use by downstream render nodes.
The method reads the GameObject's own width and height (rather than frame dimensions), applies the display origin offset, handles horizontal and vertical flipping, then builds a combined transform matrix from the camera view, the optional parent matrix, and the sprite's own position, rotation, and scale. The resulting four corner coordinates are written into this.quad, and are pixel-rounded if vertex rounding is required for this GameObject and camera combination.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| drawingContext | Phaser.Renderer.WebGL.DrawingContext | No | The current drawing context. |
| gameObject | Phaser.GameObjects.GameObject | No | The GameObject being rendered. |
| texturerNode | Phaser.Renderer.WebGL.RenderNodes.RenderNode | Yes | The texturer node used to texture the GameObject. This contains relevant data on the dimensions of the object. It is unused here. |
| parentMatrix | Phaser.GameObjects.Components.TransformMatrix | Yes | This transform matrix is defined if the game object is nested. |
| element | object | Yes | The 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.TransformerImage#run
Source: src/renderer/webgl/renderNodes/transformer/TransformerTileSprite.js#L50
Since: 4.0.0
Inherited Members
From Phaser.Renderer.WebGL.RenderNodes.RenderNode:
From Phaser.Renderer.WebGL.RenderNodes.TransformerImage: