Line
Extends :: Obj
A class that defines a line with two coordinates The position vector pos and endPos.
This class must be accessed through the iio package.
Constructors
These functions are used to instantiate new instances of the Line class. Constructor functions must be preceded by the new keyword.
iio.Line( Vector: v1, v2 )
iio.Line( Number: x1, y1, x2, y2 )
iio.Line( Number: x1, y1, Vector v2 )
iio.Line( Vector v1, Number: x2, y2 )
- Creates a line starting at the first given vector and ending at the second given vector. The default value for any undefined coordinate is 0.
var l1 = new iio.Line(); var l2 = new iio.Line(0,0,io.canvas.width,io.canvas.height); var topRight = new iio.Vec(io.canvas.width,0); var l3 = new iio.Line(topRight,io.canvas.center); var l4 = new iio.Line(0,io.canvas.height,topRight); var l5 = new iio.Line(io.canvas.center,0,0);
Graphics Properties
The following properties can are attached by the iio Graphics Engine. Note that these properties are 'undefined' by default, so you must define them with their set functions or set their values directly.
.styles.alpha :: Number
.styles.strokeStyle :: Color||Pattern||Gradient
.styles.lineWidth :: Number
.styles.shadow :: Object
.styles.fxFade :: Object
Functions
These functions are added by the Line class, and available to all instantiated Line objects.
.clone()
:: Returns Line
- returns a new Line with the same properties as this one. Makes a hard copy of the object.
//clone a line var lineClone = line.clone();