Rect
Extends :: Poly :: Shape :: Obj
A class that defines a rectangle with a position and 4 corner vertices. The position vector pos is at the center of the rectangle.
This class must be accessed through the iio package.
Constructors
These functions are used to instantiate new instances of the Rect class. Constructor functions must be preceded by the new keyword.
iio.Rect( Vector position, Number: width, height )
iio.Rect( Number x, y, width, height )
- creates a rectangle with the given position and dimensions. If the height is omitted, a square will be created with the width as its size.
- The default value for all parameters is 0.
//create a 60x60 square at canvas center var square = new iio.Rect(io.canvas.center,60); //create a 40x60 rectangle at 0,0 var rect = new iio.Rect(0,0,40,60);
Inherited Properties
Rect :: Poly :: Shape :: Obj
Poly.vertices :: Array
Poly.width :: Number
Poly.height :: Number
Poly.originToLeft :: Number
Poly.originToTop :: Number
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.
Kinematics Properties
The following properties can are attached by the iio Kinematics Engine. Note that these properties are 'undefined' by default, so you must define them with their set functions or set their values directly.
Kinematics Functions
The following functions can are attached by the iio Kinematics Engine. Note that you must call the enableKinematics function before you can utilize any of these functions.