Cannon.Display.Rectangle
y-lohse edited this page Jan 2, 2013
·
2 revisions
Implements the Cannon.ChildSystem and the Cannon.DisplayObject.
Draws a simple rectangle.
This page only covers the properties and function that are particular for the rectangle, but the actual object will also contain all properties and functions from ChildSystem and DisplayObject.
The x position of the rectangles top left corner
The y position of the rectangles top left corner
The rectangles width
The rectangles height
Contains the coordinates of the rectangles center in the form [x, y]
- x:Float
- y:Float
- width:Float
- height:Float
Creates a new Rectangle. All parameters are optional, the defaults are 0 for the coordinates and 50 for width and height
var rectangle = new Cannon.Display.Rectangle(50, 50, 100, 20);