Specifications
The height of the rectangle.
height : Number
The position of the top of the rectangle. This is defined as
top = y.
top : Number
The position of the bottom of the rectangle. This is defined
as bottom = y + height + 1.
bottom : Number
The position of the rectangle's left side. This is defined as
left = x
left : Number
The position of the rectangle's right side. This is defined as
right = x + width + 1.
right : Number
The center of the rectangle.
center : Point
Rect Functions
Returns true if the rectangle has a width and height of 0.
var empty = new Rect();
isNull() : Boolean
empty.isNull(); // true;
var square = new Rect( 10, 10, 10, 10 );
square.isNull(); // false;
Returns true if the rectangle is empty, meaning that it has width and/or
height that is negative.
var rect = new Rect( 10, 10, -10, -10 );
isEmpty() : Boolean
rect.isEmpty(); // true
var rect = new Rect( 10, 10, 10, 10 );
rect.isEmpty(); // false
Returns true if the rectangle contains the other rectangle.
new Rect( 0, 0, 100, 100 ).contains( new Rect( 10, 10,
contains( otherRect : Rect ) :
Boolean
10, 10 ) ); // true
new rect( 10, 10, 10, 10 ).contains( new Rect( 0, 0,
100, 100 ) ); // false
Returns the intersection between this rectangle and another
rectangle. The intersection of two rectangles is the part of the
intersection( otherRect : Rect
) : Rect
rectangles that overlap. If they do not overlap, an empty
rectangle is returned.
Returns the union of two rectangles. The union is a
rectangle large enough to encompass both rectangles.
union( otherRect : Rect ) : Rect
Returns true if this rectangle intersects the other rectangle.
intersects( otherRect : Rect ) :
Boolean
Normalizes this rectangle. This means changing the prefix
of the width and/or height if they are negative. After being
normalized, a rectangle will no longer be empty
normalize( )
380
Enfocus Switch 10