Store width and height integer Dimensions and provides various methods of manipulations.
public var height:int
public var width:int
public function Dimension(w:int = 0, h:int = 0)
Dimension Constructor
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
| Boolean — true if this Dimension properly contains the one specified
|
public function equals(d:Dimension):Boolean
Returns whether the input Object is equivalent to this Dimension. true
if
the Object is a Dimension and its width and height are equal to this Dimension's width
and height, false
otherwise.
Parameters
| d:Dimension — the Object being tested for equality
|
Returns
| Boolean — true if the given object is equal to this dimension
|
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 ) — Value by which the width should be increased
|
|
| h:Number (default = 0 ) — Value by which the height should be increased
|
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 used to perform the min()
|
Returns
public function isEmpty():Boolean
Returns true
if the Dimension has width or height greater than 0.
Returns
| Boolean — true if this Dimension is empty
|
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. Returns this for convenience.
Parameters
| w:Number (default = 0 ) — the value by which the width is to be scaled
|
|
| h:Number (default = 0 ) — the value by which the height is to be scaled
|
Returns
public function shrink(w:Number = 0, h:Number = 0):Dimension
Reduces the width of this Dimension by w, and reduces the height of this
Dimension by h. Returns this for convenience.
Parameters
| w:Number (default = 0 ) — the value by which the width is to be reduced
|
|
| h:Number (default = 0 ) — the value by which the height is to be reduced
|
Returns
public function toString():String
Returns
public function union(d:Dimension):Dimension
Sets the width of this Dimension to the greater of this Dimension's width and
d.width. Likewise for this Dimension's height.
Parameters
| d:Dimension — the Dimension to union with this Dimension
|
Returns
Copyright © 2008-2012 jason m horwitz, Sekati LLC. All Rights Reserved.