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

DrawLine

A RenderNode which computes the geometry of a line segment.

Constructor

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

Inherited Methods

From Phaser.Renderer.WebGL.RenderNodes.RenderNode:


Public Methods

run

<instance> run(drawingContext, currentMatrix, ax, ay, bx, by, aLineWidth, bLineWidth, vertices)

Description:

Get the transformed vertices of a line segment as a quad.

The values are pushed to a vertices list in the order TL, BL, BR, TR.

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.
axnumberNoThe x coordinate of the start of the line.
aynumberNoThe y coordinate of the start of the line.
bxnumberNoThe x coordinate of the end of the line.
bynumberNoThe y coordinate of the end of the line.
aLineWidthnumberNoThe width of the line at the start.
bLineWidthnumberNoThe width of the line at the end.
verticesArray.<number>NoThe list to which the vertices are assigned.

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

Source: src/renderer/webgl/renderNodes/DrawLine.js#L29
Since: 4.0.0


Inherited Members

From Phaser.Renderer.WebGL.RenderNodes.RenderNode: