ART.Path
ART.Path lets you create and manipulate arbitrary paths which you could draw using ART.Shape.
You can also use paths to place objects at various points along a path.
You create a path by issues one or more commands which moves a pointer and draw lines from the
previous position.
A move command can be used to move the pointer without drawing a line. This effectively creates
several sub-paths within a path.
ART.Path method: constructor
Syntax:
var path = new ART.Path([path]);
Arguments:
- path - (mixed, optional) An already existing path. The following options are possible:
- ART.Path - If path is already an instance of ART.Path, it will copy the path.
- string - A SVG path that will be parsed by ART.Path
ART.Path method: move
Moves the pointer relatively to the last point without drawing a line.
Syntax:
path.move(x, y);
Arguments:
- x - (number) The amount of pixels in horizontal direction.
- y - (number) The amount of pixels in vertical direction.
Returns:
ART.Path method: moveTo
Moves the pointer to an absolute point without drawing a line.
Syntax:
path.moveTo(x, y);
Arguments:
- x - (number) The position in horizontal direction.
- y - (number) The position in vertical direction.
Returns:
ART.Path method: line
Draws a line relatively from the last point.
Syntax:
path.line(x, y);
Arguments:
- x - (number) The amount of pixels in horizontal direction.
- y - (number) The amount of pixels in vertical direction.
Returns:
ART.Path method: lineTo
Draws a line to an absolute point from the last point.
Syntax:
path.lineTo(x, y);
Arguments:
- x - (number) The position in horizontal direction.
- y - (number) The position in vertical direction.
Returns:
ART.Path method: curve
// write me
ART.Path method: curveTo
// write me
ART.Path method: arc
// write me
ART.Path method: arcTo
// write me
ART.Path method: counterArc
Same as arc but the line is drawn counter-clockwise.
ART.Path method: counterArcTo
Same as arcTo but the line is drawn counter-clockwise.
ART.Path method: close
Draws a line to the first point in the current sub-path and begins a new sub-path.
Syntax:
path.close();
Returns:
ART.Path method: reset
Resets the current path to a blank path.
Syntax:
path.reset();
Returns:
- This ART.Path instance, now empty