Path2D

Extends
Shape
Methods
7
Fields
2

Getting one

Path2D.new()

Methods

MethodReturnsDescription
moveTo(number, number)()Start a subpath at x, y.
lineTo(number, number)()A line to x, y; an error with no moveTo first.
quadTo(number, number, number, number)()A quadratic curve through control point 1 to point 2.
curveTo(number, number, number, number, number, number)()A cubic curve through two control points to point 3.
closePath()()Close the subpath.
reset()()Empty the path.
new()Path2DAn empty non-zero path (Path2D.Double.new() reaches it too).

Fields

FieldTypeDescription
DoublePath2DClassPath2D.Double: Path2D itself, so Path2D.Double.new(...) is Path2D.new(...).
FloatPath2DClassPath2D.Float: Path2D itself, so Path2D.Float.new(...) is Path2D.new(...).

Returned by

MethodReturnsDescription
Path2DClass.newPath2DAn empty non-zero path (Path2D.Double.new() reaches it too).

Method details

moveTo

moveTo: (Path2D, number, number) -> ()

Start a subpath at x, y.

lineTo

lineTo: (Path2D, number, number) -> ()

A line to x, y; an error with no moveTo first.

quadTo

quadTo: (Path2D, number, number, number, number) -> ()

A quadratic curve through control point 1 to point 2.

curveTo

curveTo: (Path2D, number, number, number, number, number, number) -> ()

A cubic curve through two control points to point 3.

new

new: () -> Path2D

An empty non-zero path (Path2D.Double.new() reaches it too).