Path2D
js.html.Path2D (extern class)
The Path2D
interface of the Canvas 2D API is used to declare paths that are then later used on CanvasRenderingContext2D
objects. The path methods of the CanvasRenderingContext2D
interface are present on this interface as well and are allowing you to create paths that you can retain and replay as required on a canvas.
Documentation Path2D by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See:
Instance Members
addPath(path: Path2D, ?transformation: js.html.svg.Matrix): Void
Adds a path to the current path.
Name | Type | Default |
---|---|---|
path |
Path2D | |
transformation |
js.html.svg.Matrix | (optional) |
closePath(): Void
Name | Type |
---|---|
x |
Float |
y |
Float |
Name | Type |
---|---|
x |
Float |
y |
Float |
Name | Type |
---|---|
cpx |
Float |
cpy |
Float |
x |
Float |
y |
Float |
Name | Type |
---|---|
cp1x |
Float |
cp1y |
Float |
cp2x |
Float |
cp2y |
Float |
x |
Float |
y |
Float |
Name | Type |
---|---|
x1 |
Float |
y1 |
Float |
x2 |
Float |
y2 |
Float |
radius |
Float |
Name | Type |
---|---|
x |
Float |
y |
Float |
w |
Float |
h |
Float |
arc(x: Float, y: Float, radius: Float, startAngle: Float, endAngle: Float, ?anticlockwise: Bool = false): Void
Name | Type | Default |
---|---|---|
x |
Float | |
y |
Float | |
radius |
Float | |
startAngle |
Float | |
endAngle |
Float | |
anticlockwise |
Bool | false |
ellipse(x: Float, y: Float, radiusX: Float, radiusY: Float, rotation: Float, startAngle: Float, endAngle: Float, ?anticlockwise: Bool = false): Void
Name | Type | Default |
---|---|---|
x |
Float | |
y |
Float | |
radiusX |
Float | |
radiusY |
Float | |
rotation |
Float | |
startAngle |
Float | |
endAngle |
Float | |
anticlockwise |
Bool | false |
Name | Type |
---|---|
pathString |
String |