Rectangle
| Kind of class: | class |
|---|---|
| Inherits from: | CoreObject |
| Implements: | |
| Version: | 01/03/07 |
| Author: | Aaron Clinger |
| Classpath: | org.casaframework.math.geom.Rectangle |
| File last modified: | Wednesday, 24 January 2007, 21:45:39 |
Stores position and size of a rectangle (or square).
Summary
Constructor
Instance properties
Instance properties inherited from CoreObject
Instance methods
- getX
- setX
- getY
- setY
- getX2
- setX2
- getY2
- setY2
- getPosition
- setPosition
- getWidth
- setWidth
- getHeight
- setHeight
- getPerimeter
- getArea
- containsPoint
- equals
- clone
- destroy
Instance methods inherited from CoreObject
Constructor
Rectangle
function Rectangle (
x:Number,
y:Number,
width:Number,
height:Number)
Creates new rectangle object.
Parameters:
x :
The horizontal position of the rectangle.
y :
The vertical position of the ellipse.
width :
Width of the rectangle.
height:
[optional] Height of the rectangle. If undefined assumes
height matches width (Creates square).Instance methods
clone
function clone (
) : Rectangle
Returns:
A new rectangle object with the same values as this rectangle.
containsPoint
function containsPoint (
pointObject:Point) : Boolean
Finds if point is contained inside the shape's perimeter.
#Returns:
Returns
#true if area contains point; otherwise false.Specified by:
destroy
function destroy (
) : Void
Removes internal variables, intervals, enter frames, internal MovieClips and event observers to allow the object to be garbage collected.
Always call
#Always call
destroy() before deleting/removing object instance.Specified by:
equals
function equals (
rectangleObject:Rectangle) : Boolean
Determines whether the rectangle specified in the
rectangleObject parameter is equal to this rectangle object.Parameters:
rectangleObject:
A defined Rectangle object.
Returns:
Returns
true if shape's location and size is identical; otherwise false.getHeight
function getHeight (
) : Number
Returns:
The height of the shape at its tallest point.
#Specified by:
getPerimeter
function getPerimeter (
) : Number
Returns:
The distance around the shape.
#Specified by:
getWidth
function getWidth (
) : Number
Returns:
The width of the shape at its widest point.
#Specified by:
getX2
function getX2 (
) : Number
Returns:
The right X position of the rectangle.
getY2
function getY2 (
) : Number
Returns:
The bottom Y position of the rectangle.
setHeight
function setHeight (
height:Number) : Void
Sets the height of the shape at its tallest point.
#Parameters:
height:
Height of the shape.
#Specified by:
setPosition
function setPosition (
pointObject:Point) : Void
Sets the value of the top left X and Y position of the shape.
#Specified by:
setWidth
function setWidth (
width:Number) : Void
Sets the width of the shape at its widest point.
#Parameters:
width:
Width of the shape.
#Specified by:
setX
function setX (
x:Number) : Void
Sets the X coordinate.
#Parameters:
x:
The horizontal coordinate of the point.
#Specified by:
setX2
function setX2 (
x:Number) : Void
Sets the right position of the rectangle.
Parameters:
x:
The right X position of the rectangle.
setY
function setY (
y:Number) : Void
Sets the Y coordinate.
#Parameters:
y:
The vertical coordinate of the point.
#Specified by:
setY2
function setY2 (
y:Number) : Void
Sets the bottom position of the rectangle.
Parameters:
y:
The bottom Y position of the rectangle.