FillPath
A RenderNode which fills a closed path with solid color.
It works by taking the array of path data and passing it through Earcut, which triangulates the polygon into a list of triangles. Each triangle is then submitted to the batch for rendering. The first and last points in the path are always preserved; interior points may be skipped based on the detail threshold.
Constructor
new FillPath(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/FillPath.js#L11
Since: 4.0.0
Inherited Methods
From Phaser.Renderer.WebGL.RenderNodes.RenderNode:
Public Methods
run
<instance> run(drawingContext, currentMatrix, submitterNode, path, tintTL, tintTR, tintBL, detail, lighting)
Description:
Render the path using Earcut.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| drawingContext | Phaser.Renderer.WebGL.DrawingContext | No | The context currently in use. |
| currentMatrix | Phaser.GameObjects.Components.TransformMatrix | No | The current transform matrix. |
| submitterNode | Phaser.Renderer.WebGL.RenderNodes.BatchHandlerTriFlat | No | The Submitter node to use. |
| path | Array.<Phaser.Types.GameObjects.Graphics.WidePoint> | No | The points that define the line segments. |
| tintTL | number | No | The top-left tint color. |
| tintTR | number | No | The top-right tint color. |
| tintBL | number | No | The bottom-left tint color. |
| detail | number | No | The level of detail to use when filling the path, in pixels. Any interior point whose x and y distances from the previous accepted point are both within this threshold is skipped. The first and last points are always kept. A value of 0 disables simplification and keeps all points. |
| lighting | boolean | No | Whether to apply lighting effects to the path. |
Overrides: Phaser.Renderer.WebGL.RenderNodes.RenderNode#run
Source: src/renderer/webgl/renderNodes/FillPath.js#L36
Since: 4.0.0
Inherited Members
From Phaser.Renderer.WebGL.RenderNodes.RenderNode: