Skip to main content
Version: Phaser v4.0.0-rc.6

FillPath

A RenderNode which fills a path.

It works by taking the array of path data and then passing it through

Earcut, which creates a list of polygons.

Each polygon is then added to the batch.

The polygons are triangles, but they're rendered as quads

to be compatible with other batched quads.

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. Points which are only this far apart in screen space are combined. It is ignored if the entire path is equal to or shorter than this distance.
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: