Properties
.currentPath : Path
The current path that is being generated.
Default is null.
Methods
.bezierCurveTo( aCP1x : number, aCP1y : number, aCP2x : number, aCP2y : number, aX : number, aY : number ) : ShapePath
Adds an instance of CubicBezierCurve to the path by connecting the current point with the given one.
| aCP1x |
The x coordinate of the first control point. |
| aCP1y |
The y coordinate of the first control point. |
| aCP2x |
The x coordinate of the second control point. |
| aCP2y |
The y coordinate of the second control point. |
| aX |
The x coordinate of the end point. |
| aY |
The y coordinate of the end point. |
- Returns: A reference to this shape path.
.lineTo( x : number, y : number ) : ShapePath
Adds an instance of LineCurve to the path by connecting the current point with the given one.
| x |
The x coordinate of the end point. |
| y |
The y coordinate of the end point. |
- Returns: A reference to this shape path.
.moveTo( x : number, y : number ) : ShapePath
Creates a new path and moves it current point to the given one.
| x |
The x coordinate. |
| y |
The y coordinate. |
- Returns: A reference to this shape path.
.quadraticCurveTo( aCPx : number, aCPy : number, aX : number, aY : number ) : ShapePath
Adds an instance of QuadraticBezierCurve to the path by connecting the current point with the given one.
| aCPx |
The x coordinate of the control point. |
| aCPy |
The y coordinate of the control point. |
| aX |
The x coordinate of the end point. |
| aY |
The y coordinate of the end point. |
- Returns: A reference to this shape path.
.splineThru( pts : Array.<Vector2> ) : ShapePath
Adds an instance of SplineCurve to the path by connecting the current point with the given list of points.
| pts |
An array of points in 2D space. |
- Returns: A reference to this shape path.
.toShapes( isCCW : boolean ) : Array.<Shape>
Converts the paths into an array of shapes.
| isCCW |
By default solid shapes are defined clockwise (CW) and holes are defined counterclockwise (CCW).
If this flag is set to |
- Returns: An array of shapes.