Skip to main content
Version: Phaser v4.0.0

FillTri

A RenderNode which renders a single filled triangle with per-vertex tint colors. It is used internally by Phaser to draw flat-colored triangles, such as those produced by the Graphics Game Object when filling shapes. Each of the three vertices can carry an independent packed ARGB tint color, allowing smooth color gradients across the triangle face. An optional transform matrix can be supplied to position the triangle within the world before it is submitted to the GPU batch.

Constructor

new FillTri(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/FillTri.js#L10
Since: 4.0.0

Inherited Members

From Phaser.Renderer.WebGL.RenderNodes.RenderNode:


Inherited Methods

From Phaser.Renderer.WebGL.RenderNodes.RenderNode:


Public Methods

run

<instance> run(drawingContext, currentMatrix, submitterNode, xA, yA, xB, yB, xC, yC, tintA, tintB, tintC, lighting)

Description:

Batches a filled triangle for rendering in the current drawing context. The three vertices are optionally transformed by currentMatrix before being passed to submitterNode, which writes them into the GPU vertex batch. Per-vertex tint colors allow the triangle to display a smooth color gradient across its surface.

Parameters:

nametypeoptionaldescription
drawingContextPhaser.Renderer.WebGL.DrawingContextNoThe context currently in use.
currentMatrixPhaser.GameObjects.Components.TransformMatrixNoA transform matrix to apply to the vertices. If not defined, the vertices are not transformed.
submitterNodePhaser.Renderer.WebGL.RenderNodes.BatchHandlerTriFlatNoThe Submitter node to use.
xAnumberNoThe x-coordinate of the first vertex.
yAnumberNoThe y-coordinate of the first vertex.
xBnumberNoThe x-coordinate of the second vertex.
yBnumberNoThe y-coordinate of the second vertex.
xCnumberNoThe x-coordinate of the third vertex.
yCnumberNoThe y-coordinate of the third vertex.
tintAnumberNoThe tint color of the first vertex, as a packed ARGB integer.
tintBnumberNoThe tint color of the second vertex, as a packed ARGB integer.
tintCnumberNoThe tint color of the third vertex, as a packed ARGB integer.
lightingbooleanNoWhether to apply lighting effects to the triangle.

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

Source: src/renderer/webgl/renderNodes/FillTri.js#L48
Since: 4.0.0