Class GSBounds
Represents a 2-dimensional bounding box. If a GSBounds instance is
in the NZMG coordinate system the minimum coordinate represents the bottom left corner
of the bounding box as the value of the y axis increases from bottom to top.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
GSBounds(minX, minY, maxX, maxY)
Creates a new
GSBounds object. |
| Property Attributes | Property Name and Description |
|---|---|
|
The x coordinate of the top right corner of the bounding box
|
|
|
The y coordinate of the top right corner of the bounding box
|
|
|
The x coordinate of the bottom left corner of the bounding box
|
|
|
The y coordinate of the bottom left corner of the bounding box
|
| Method Attributes | Method Name and Description |
|---|---|
|
contains(point)
Returns
true if the specified point is contained within this
bounding box. |
|
|
intersection(bounds)
Calculates the intersection between this bounds object and another
|
|
|
overlaps(bounds)
Returns
true if these bounds overlaps the specified bounds object |
|
|
toString()
Outputs this bounds properties as a String
|
Class Detail
GSBounds(minX, minY, maxX, maxY)
Creates a new
GSBounds object. The new instance may optionally be
initialized with its bounds.
- Parameters:
- {float} minX
- the x coordinate of the bottom left corner of the bounding box
- {float} minY
- the y coordinate of the bottom left corner of the bounding box
- {float} maxX
- the x coordinate of the top right corner of the bounding box
- {float} maxY
- the y coordinate of the top right corner of the bounding box
Property Detail
{float}
maxX
The x coordinate of the top right corner of the bounding box
{float}
maxY
The y coordinate of the top right corner of the bounding box
{float}
minX
The x coordinate of the bottom left corner of the bounding box
{float}
minY
The y coordinate of the bottom left corner of the bounding box
Method Detail
{boolean}
contains(point)
Returns
true if the specified point is contained within this
bounding box.
- Parameters:
- {GSPoint} point
- the point to test
- Returns:
- {boolean}
trueif the point is within this bounding box
{GSBounds}
intersection(bounds)
Calculates the intersection between this bounds object and another
- Parameters:
- bounds
- Returns:
- {GSBounds} the intersection of this bounds with the bounds passed to the
function or
nullif the bounds do not intersect
{boolean}
overlaps(bounds)
Returns
true if these bounds overlaps the specified bounds object
- Parameters:
- {GSBounds} bounds
- the bounds to test
- Returns:
- {boolean}
trueif these bounds overlaps the specified bounds object
{String}
toString()
Outputs this bounds properties as a String
- Returns:
- {String} this bounds properties as a String