Skip to main content
Version: Phaser v4.0.0

SubmitterQuad

The SubmitterQuad RenderNode submits data for rendering a single Image-like GameObject. It uses a BatchHandler to render the image as part of a batch.

This node receives the drawing context, game object, and parent matrix. It also receives the texturer, tinter, and transformer nodes from the node that invoked it. This allows the behavior to be configured by setting the appropriate nodes on the GameObject for individual tweaks, or on the invoking Renderer node for global changes.

Constructor

new SubmitterQuad(manager, [config])

Parameters

nametypeoptionaldescription
managerPhaser.Renderer.WebGL.RenderNodes.RenderNodeManagerNoThe manager that owns this RenderNode.
configPhaser.Types.Renderer.WebGL.RenderNodes.SubmitterQuadConfigYesThe configuration object for this RenderNode.

Scope: static

Extends

Phaser.Renderer.WebGL.RenderNodes.RenderNode

Source: src/renderer/webgl/renderNodes/submitter/SubmitterQuad.js#L14
Since: 4.0.0

Inherited Members

From Phaser.Renderer.WebGL.RenderNodes.RenderNode:


Public Members

batchHandler

batchHandler: string

Description:

The key of the RenderNode used to render data.

Source: src/renderer/webgl/renderNodes/submitter/SubmitterQuad.js#L43
Since: 4.0.0


defaultConfig

defaultConfig: Phaser.Types.Renderer.WebGL.RenderNodes.SubmitterQuadConfig

Description:

The default configuration for this RenderNode.

Source: src/renderer/webgl/renderNodes/submitter/SubmitterQuad.js#L85


Inherited Methods

From Phaser.Renderer.WebGL.RenderNodes.RenderNode:


Public Methods

run

<instance> run(drawingContext, gameObject, parentMatrix, element, texturerNode, transformerNode, [tinterNode], [normalMap], [normalMapRotation])

Description:

Processes the given GameObject and submits quad vertex data to the appropriate batch handler for rendering. This method invokes the texturer, transformer, and optional tinter nodes in sequence to compute texture coordinates, transformed vertex positions, and tint colors. If no tinter node is provided, Image-style tinting is read directly from the GameObject. It then calls setRenderOptions to resolve lighting and smooth pixel art settings before passing all assembled data to the batch handler.

Parameters:

nametypeoptionaldescription
drawingContextPhaser.Renderer.WebGL.DrawingContextNoThe current drawing context.
gameObjectPhaser.GameObjects.GameObjectNoThe GameObject being rendered.
parentMatrixPhaser.GameObjects.Components.TransformMatrixNoThe parent matrix of the GameObject.
elementobjectNoThe specific element within the game object. This is used for objects that consist of multiple quads.
texturerNodePhaser.Renderer.WebGL.RenderNodes.RenderNodeNoThe texturer node used to texture the GameObject. You may pass a TexturerImage node or an object containing equivalent data without a run method.
transformerNodePhaser.Renderer.WebGL.RenderNodes.RenderNode | ObjectNoThe transformer node used to transform the GameObject. You may pass a transformer node or an object with a quad property.
tinterNodePhaser.Renderer.WebGL.RenderNodes.RenderNode, Omit.<Phaser.Renderer.WebGL.RenderNodes.RenderNode, 'run'>YesThe tinter node used to tint the GameObject. You may pass a tinter node or an object containing equivalent data without a run method. If omitted, Image-style tinting will be used.
normalMapPhaser.Renderer.WebGL.Wrappers.WebGLTextureWrapperYesThe normal map texture to use for lighting. If omitted, the normal map texture of the GameObject will be used, or the default normal map texture of the renderer.
normalMapRotationnumberYesThe rotation of the normal map texture. If omitted, the rotation of the GameObject will be used.

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

Source: src/renderer/webgl/renderNodes/submitter/SubmitterQuad.js#L97
Since: 4.0.0


setRenderOptions

<instance> setRenderOptions(gameObject, [normalMap], [normalMapRotation])

Description:

Resolves and stores render options for the current GameObject into _renderOptions before it is submitted to the batch handler. This includes determining the correct normal map texture and rotation for lighting (falling back to the game object's base texture data source, then the renderer's default normal texture), resolving self-shadow settings (falling back to the global game configuration if not set on the object), and determining the smooth pixel art setting from either the base texture or the global game configuration. If the GameObject has no lighting component, the lighting option is set to null.

Parameters:

nametypeoptionaldescription
gameObjectPhaser.GameObjects.GameObjectNoThe GameObject being rendered.
normalMapPhaser.Renderer.WebGL.Wrappers.WebGLTextureWrapperYesThe normal map texture to use for lighting. If omitted, it will be resolved from the game object's base texture data source or the renderer's default normal texture.
normalMapRotationnumberYesThe rotation of the normal map texture, in radians. If omitted or NaN, it will be resolved from the game object's rotation or its world transform matrix if it belongs to a container.

Source: src/renderer/webgl/renderNodes/submitter/SubmitterQuad.js#L203
Since: 4.0.0