Skip to main content
Version: Phaser v4.0.0

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

nametypeoptionaldescription
managerPhaser.Renderer.WebGL.RenderNodes.RenderNodeManagerNoThe manager that owns this RenderNode.

Scope: static

Extends

Phaser.Renderer.WebGL.RenderNodes.RenderNode

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:

nametypeoptionaldescription
drawingContextPhaser.Renderer.WebGL.DrawingContextNoThe context currently in use.
currentMatrixPhaser.GameObjects.Components.TransformMatrixNoThe current transform matrix.
submitterNodePhaser.Renderer.WebGL.RenderNodes.BatchHandlerTriFlatNoThe Submitter node to use.
pathArray.<Phaser.Types.GameObjects.Graphics.WidePoint>NoThe points that define the line segments.
tintTLnumberNoThe top-left tint color.
tintTRnumberNoThe top-right tint color.
tintBLnumberNoThe bottom-left tint color.
detailnumberNoThe 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.
lightingbooleanNoWhether 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: