XShape
Extends :: SimpleRect :: Shape :: Obj
Essentially, all this class does is provide a class so that the Graphics Engine can override SimpleRect's draw function to draw an x-shape instead of a rectangle.
Therefore, although this class inherits all the shape and image graphics properties, none of them can be used.
Think of this class as extending a line when it comes to rendering.
Kinematics are still available though.
This class must be accessed through the iio package.
Constructors
These functions are used to instantiate new instances of the XShape class. Constructor functions must be preceded by the new keyword.
iio.XShape( Vector position, Number: width, height )
iio.XShape( Number x, y, width, height )
- creates a x-shape with the given position and dimensions. If the height is omitted, a square x-shape will be created with the width as its size.
- The default value for all parameters is 0.
//create a 60x60 x-shape at canvas center var squareX = new iio.XShape(io.canvas.center,60); //create a 40x60 x-shape at 0,0 var x = new iio.XShape(0,0,40,60);
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.
Graphics Functions
The following functions can are attached by the iio Graphics Engine.
.draw
.clearDraw
.fade
.fadeIn
.fadeOut
.setShadow
.setShadowColor
.setShadowBlur
.setShadowOffset
.setAlpha
.setStrokeStyle
.setLineWidth
.setFillStyle
.addImage
.createWithImage
.flipImage
.setImgOffset
.setImgSize
.setImgScale
.setImgRotation
.addAnim
.createWithAnim
.setAnim
.setAnimKey
.setAnimFrame
.nextAnimFrame
.playAnim
.stopAnim
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.