nx.js
Classes

Path2D

Declares a path that can then be used on a CanvasRenderingContext2D object. The path methods of the CanvasRenderingContext2D interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired.

See

https://developer.mozilla.org/docs/Web/API/Path2D

Implements

Constructors

new Path2D()

new Path2D(path?): Path2D

Parameters

ParameterType
path?string | Path2D

Returns

Path2D

Methods

addPath()

addPath(path): void

Parameters

ParameterType
pathPath2D

Returns

void

Implementation of

globalThis.Path2D.addPath


arc()

arc(x, y, r, start, end, ccw): void

Parameters

ParameterType
xnumber
ynumber
rnumber
startnumber
endnumber
ccwboolean

Returns

void

Implementation of

globalThis.Path2D.arc


arcTo()

arcTo(x1, y1, x2, y2, r): void

Parameters

ParameterType
x1number
y1number
x2number
y2number
rnumber

Returns

void

Implementation of

globalThis.Path2D.arcTo


bezierCurveTo()

bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y): void

Parameters

ParameterType
cp1xnumber
cp1ynumber
cp2xnumber
cp2ynumber
xnumber
ynumber

Returns

void

Implementation of

globalThis.Path2D.bezierCurveTo


closePath()

closePath(): void

Returns

void

Implementation of

globalThis.Path2D.closePath


ellipse()

ellipse(x, y, rx, ry, angle, start, end, ccw): void

Parameters

ParameterType
xnumber
ynumber
rxnumber
rynumber
anglenumber
startnumber
endnumber
ccwboolean

Returns

void

Implementation of

globalThis.Path2D.ellipse


lineTo()

lineTo(x, y): void

Parameters

ParameterType
xnumber
ynumber

Returns

void

Implementation of

globalThis.Path2D.lineTo


moveTo()

moveTo(x, y): void

Parameters

ParameterType
xnumber
ynumber

Returns

void

Implementation of

globalThis.Path2D.moveTo


quadraticCurveTo()

quadraticCurveTo(cpx, cpy, x, y): void

Parameters

ParameterType
cpxnumber
cpynumber
xnumber
ynumber

Returns

void

Implementation of

globalThis.Path2D.quadraticCurveTo


rect()

rect(x, y, width, height): void

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Implementation of

globalThis.Path2D.rect


roundRect()

roundRect(x, y, width, height, radii?): void

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber
radii?number | number[]

Returns

void

Implementation of

globalThis.Path2D.roundRect

On this page