Skip to main content
Version: Phaser v4.0.0

TransformerTile

A RenderNode which handles transformation data for a single Tile within a TilemapLayer.

This node extends TransformerImage with tile-specific logic, including support for tileset offsets, per-tile flip flags, and per-tile rotation. It is used by the TilemapLayer rendering pipeline to position and orient each individual tile in world space before it is submitted to the batch renderer.

Unlike TransformerImage, which operates on a standalone Game Object, this node reads positional and flip data from a tile element descriptor (element) rather than directly from the Game Object, allowing it to handle the many tiles that make up a single TilemapLayer in a single render pass.

Constructor

new TransformerTile(manager, [config])

Parameters

nametypeoptionaldescription
managerPhaser.Renderer.WebGL.RenderNodes.RenderNodeManagerNoThe manager that owns this RenderNode.
configobjectYesThe configuration object for this RenderNode.

Scope: static

Extends

Phaser.Renderer.WebGL.RenderNodes.TransformerImage

Source: src/renderer/webgl/renderNodes/transformer/TransformerTile.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 and stores the world-space transform quad for a single tile element, ready for submission to the batch renderer.

This method builds the final transformation by combining the camera view matrix (with scroll factor applied), an optional parent matrix for nested Game Objects, and a per-tile sprite matrix derived from the tile's pixel position, rotation, and the TilemapLayer's scale. Tileset tile offsets are factored into the world position, and horizontal or vertical flips are applied by negating the quad dimensions. If vertex rounding is enabled on the camera, the resulting quad coordinates are rounded to the nearest integer to avoid sub-pixel rendering artefacts.

Parameters:

nametypeoptionaldescription
drawingContextPhaser.Renderer.WebGL.DrawingContextNoThe current drawing context.
gameObjectPhaser.GameObjects.GameObjectNoThe GameObject being rendered.
texturerNodePhaser.Renderer.WebGL.RenderNodes.RenderNodeNoThe texturer node used to texture the GameObject. This contains relevant data on the dimensions of the object.
parentMatrixPhaser.GameObjects.Components.TransformMatrixYesThis transform matrix is defined if the game object is nested.
elementobjectYesThe tile element descriptor for the tile being rendered. Contains the tile's pixel position, rotation, flip flags, and GID index used to look up the tileset.

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

Source: src/renderer/webgl/renderNodes/transformer/TransformerTile.js#L45
Since: 4.0.0


Inherited Members

From Phaser.Renderer.WebGL.RenderNodes.RenderNode:

From Phaser.Renderer.WebGL.RenderNodes.TransformerImage: