The Dimension class stores width and height dimensions and provides
various methods of manipulations.
public var height:int
The height.
public var width:int
The width.
public function Dimension(w:int = 0, h:int = 0)
Constructor for Dimension instances.
Parameters
| w:int (default = 0) — The width
|
| |
| h:int (default = 0) — The height
|
public function clone():Dimension
Creates and returns a copy of this Dimension.
Returns
public function contains(d:Dimension):Boolean
Returns true if the passed Dimension fits within the
bounds of this Dimension. A Dimension of the same size is
considered to "fit".
Parameters
Returns
public function containsProper(d:Dimension):Boolean
Returns true if this Dimension properly contains the one
specified - proper containment is defined as containment using
"<", instead of "<=".
Parameters
Returns
public function equals(d:Dimension):Boolean
Test equality between this Dimension and another Dimension.
Parameters
| d:Dimension — The Dimension being tested for equality
|
Returns
public function expand(w:Number = 0, h:Number = 0):Dimension
Expands the size of this Dimension by the specified width and height.
Parameters
| w:Number (default = 0) — The amount the width will be increased by.
|
| |
| h:Number (default = 0) — The amount the height will be increased by.
|
Returns
public function getArea():Number
Returns the area of this Dimension.
Returns
public function intersect(d:Dimension):Dimension
This Dimension is intersected with the one specified. intersection is
performed by taking the min of the values from each dimension.
Parameters
| d:Dimension — The Dimension to intersect with this Dimension.
|
Returns
public function isEmpty():Boolean
Returns true if the Dimension has width or
height greater than 0.
Returns
public function scale(w:Number = 0, h:Number = 0):Dimension
Scales the width of this Dimension by w and scales the
height of this Dimension by h.
Parameters
| w:Number (default = 0) — The amount the width will be scaled.
|
| |
| h:Number (default = 0) — The amount the height will be scaled.
|
Returns
public function shrink(w:Number = 0, h:Number = 0):Dimension
Reduces the width and height of this Dimension.
Parameters
| w:Number (default = 0) — The amount to reduce the width by.
|
| |
| h:Number (default = 0) — The amount to reduce the height by.
|
Returns
public function toString():String
Friendly description and for debug info.
Returns
public function union(d:Dimension):Dimension
Sets the width and height of this Dimension to to the max() value
between this Dimension and the target Dimension.
Parameters
| d:Dimension — The Dimension to union with this Dimension.
|
Returns