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
| name | type | optional | description |
|---|---|---|---|
| manager | Phaser.Renderer.WebGL.RenderNodes.RenderNodeManager | No | The manager that owns this RenderNode. |
Scope: static
Extends
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:
| name | type | optional | description |
|---|---|---|---|
| drawingContext | Phaser.Renderer.WebGL.DrawingContext | No | The context currently in use. |
| currentMatrix | Phaser.GameObjects.Components.TransformMatrix | No | A transform matrix to apply to the vertices. If not defined, the vertices are not transformed. |
| submitterNode | Phaser.Renderer.WebGL.RenderNodes.BatchHandlerTriFlat | No | The Submitter node to use. |
| xA | number | No | The x-coordinate of the first vertex. |
| yA | number | No | The y-coordinate of the first vertex. |
| xB | number | No | The x-coordinate of the second vertex. |
| yB | number | No | The y-coordinate of the second vertex. |
| xC | number | No | The x-coordinate of the third vertex. |
| yC | number | No | The y-coordinate of the third vertex. |
| tintA | number | No | The tint color of the first vertex, as a packed ARGB integer. |
| tintB | number | No | The tint color of the second vertex, as a packed ARGB integer. |
| tintC | number | No | The tint color of the third vertex, as a packed ARGB integer. |
| lighting | boolean | No | Whether 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