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

Adds to the path the path given by the argument.

MDN Reference

Parameters

ParameterType
pathPath2D

Returns

void

Implementation of

globalThis.Path2D.addPath


arc()

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

MDN Reference

Parameters

ParameterType
xnumber
ynumber
rnumber
startnumber
endnumber
ccwboolean

Returns

void

Implementation of

globalThis.Path2D.arc


arcTo()

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

MDN Reference

Parameters

ParameterType
x1number
y1number
x2number
y2number
rnumber

Returns

void

Implementation of

globalThis.Path2D.arcTo


bezierCurveTo()

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

MDN Reference

Parameters

ParameterType
cp1xnumber
cp1ynumber
cp2xnumber
cp2ynumber
xnumber
ynumber

Returns

void

Implementation of

globalThis.Path2D.bezierCurveTo


closePath()

closePath(): void

MDN Reference

Returns

void

Implementation of

globalThis.Path2D.closePath


ellipse()

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

MDN Reference

Parameters

ParameterType
xnumber
ynumber
rxnumber
rynumber
anglenumber
startnumber
endnumber
ccwboolean

Returns

void

Implementation of

globalThis.Path2D.ellipse


lineTo()

lineTo(x, y): void

MDN Reference

Parameters

ParameterType
xnumber
ynumber

Returns

void

Implementation of

globalThis.Path2D.lineTo


moveTo()

moveTo(x, y): void

MDN Reference

Parameters

ParameterType
xnumber
ynumber

Returns

void

Implementation of

globalThis.Path2D.moveTo


quadraticCurveTo()

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

MDN Reference

Parameters

ParameterType
cpxnumber
cpynumber
xnumber
ynumber

Returns

void

Implementation of

globalThis.Path2D.quadraticCurveTo


rect()

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

MDN Reference

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber

Returns

void

Implementation of

globalThis.Path2D.rect


roundRect()

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

MDN Reference

Parameters

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

Returns

void

Implementation of

globalThis.Path2D.roundRect

On this page