Rectangle
Description
A basic Rectangle class.
API overview
Constructor
Rectangle
(
_x: Number
= 0
,
_y: Number
= 0
,
_width: Number
= 0
,
_height: Number
= 0
)
Attributes
Public attributes
| bottom: Number | |
| height: Number | |
| left: Number | |
| maxX: Number | read-only |
| maxY: Number | read-only |
| minX: Number | read-only |
| minY: Number | read-only |
| right: Number | |
| top: Number | |
| width: Number | |
| x: Number | |
| y: Number |
Functions
Public functions
| clip ( cx: Number , cy: Number , cwidth: Number , cheight: Number ): Void |
native Clip the rectangle with the provided rectangle |
| clone (): Rectangle |
native Make a copy of this Rectangle |
| contains ( _x: Number , _y: Number ): Boolean |
native Returns true if x and y is inside the bounds of this rectangle |
| containsPoint ( p: Point ): Boolean |
native Returns true if p is inside the bounds of this rectangle |
| containsRect ( rect: Rectangle ): Boolean |
native Returns true if rect is entirely inside of this rectangle is inside the bounds of this rectangle |
| expandByPoint ( p: Point ): Void |
native If p is outside of the rectangle's current bounds, expand it to include p |
| intersects ( rect1: Rectangle , rect2: Rectangle ): Boolean |
static Returns true if any part of the two rectangles overlaps |
| setTo ( _x: Number , _y: Number , _width: Number , _height: Number ): Void |
native Assign the x,y,width,height of this rectangle |
Constructor
Attributes
Functions
clip ( cx: Number , cy: Number , cwidth: Number , cheight: Number ): Void
native
Clip the rectangle with the provided rectangle. The rectangle is changed contain only the intersection between it and the provided rectangle.
Parameters
| cx: Number | |
| cy: Number | |
| cwidth: Number | |
| cheight: Number |
contains ( _x: Number , _y: Number ): Boolean
native
Returns true if x and y is inside the bounds of this rectangle.
Parameters
| _x: Number | |
| _y: Number |
containsPoint ( p: Point ): Boolean
native
Returns true if p is inside the bounds of this rectangle.
Parameters
| p: Point |
containsRect ( rect: Rectangle ): Boolean
native
Returns true if rect is entirely inside of this rectangle is inside the bounds of this rectangle.
Parameters
| rect: Rectangle |
expandByPoint ( p: Point ): Void
native
If p is outside of the rectangle's current bounds, expand it to include p.
Parameters
| p: Point |
getFullTypeName
(): String
Inherited from Object
native
Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.
Returns
| String | fully qualified type name of the Object. |
getType
(): Type
Inherited from Object
native
Gets the Type that describes the Object.
Returns
| Type | The Type that describes the object. |
getTypeName
(): String
Inherited from Object
native
Gets the type name of the Object.
Returns
| String | type name of the Object. |
intersects ( rect1: Rectangle , rect2: Rectangle ): Boolean
static
Returns true if any part of the two rectangles overlaps.
Parameters
| rect1: Rectangle | |
| rect2: Rectangle |