A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle
object's top-left point (x, y) in the coordinate space, its width, and its height.
public var height:int = 0
public var width:int = 0
public var x:int = 0
public var y:int = 0
public function IntRectangle(x:int = 0, y:int = 0, width:int = 0, height:int = 0)
Creates a rectangle.
Parameters
| x:int (default = 0) |
| |
| y:int (default = 0) |
| |
| width:int (default = 0) |
| |
| height:int (default = 0) |
public function clone():IntRectangle
Duplicates current instance.
Returns
public function containsPoint(p:IntPoint):BooleanParameters
Returns
public static function creatWithRectangle(r:Rectangle):IntRectangle
Create a int point with point.
Parameters
Returns
public function equals(o:Object):Boolean
Parameters
Returns
public function getLocation():IntPoint
Returns the location of this rectangle.
Returns
public function getSize():IntDimension
Returns the size of this rectangle.
Returns
public function grow(h:int, v:int):void
Resizes the Rectangle both horizontally and vertically.
This method modifies the Rectangle so that it is
h units larger on both the left and right side,
and v units larger at both the top and bottom.
The new Rectangle has (x - h,
y - v) as its top-left corner, a
width of
width + 2h,
and a height of
height + 2v.
If negative values are supplied for h and
v, the size of the Rectangle
decreases accordingly.
The grow method does not check whether the resulting
values of width and height are
non-negative.
Parameters
| h:int — the horizontal expansion
|
| |
| v:int — the vertical expansion
|
public function leftBottom():IntPoint
Returns
public function leftTop():IntPoint
Returns
public function move(dx:int, dy:int):voidParameters
public function resize(dwidth:int = 0, dheight:int = 0):voidParameters
| dwidth:int (default = 0) |
| |
| dheight:int (default = 0) |
public function rightBottom():IntPoint
Returns
public function rightTop():IntPoint
Returns
public function setLocation(p:IntPoint):void
Sets the x, y property of the rectangle.
Parameters
public function setRect(rect:IntRectangle):void
Sets the rectangle to be as same as rect.
Parameters
public function setRectXYWH(x:int, y:int, width:int, height:int):void
Sets the rect with x, y, width and height.
Parameters
| x:int |
| |
| y:int |
| |
| width:int |
| |
| height:int |
public function setSize(size:IntDimension):void
Sets the width and height properties of the rectangle
Parameters
public function setWithRectangle(r:Rectangle):void
Sets the location with a Point, the value will be transfer to int.
Parameters
| r:Rectangle — the location to be set.
|
public function toRectangle():Rectangle
Return a Point instance with same value.
Returns
public function toString():String
Returns
public function union(r:IntRectangle):IntRectangle
Computes the union of this Rectangle with the
specified Rectangle. Returns a new
Rectangle that
represents the union of the two rectangles
Parameters
Returns
| IntRectangle —
the smallest Rectangle containing both
the specified Rectangle and this
Rectangle.
|