Class createjs.BoundingBox
Extends
.
Defined in: bounding_box.js.
Constructor Attributes | Constructor Name and Description |
---|---|
A class representing a bounding box.
|
Field Attributes | Field Name and Description |
---|---|
The right position of this bounding box.
|
|
The bottom position of this bounding box.
|
|
The left position of this bounding box.
|
|
The top position of this bounding box.
|
Method Attributes | Method Name and Description |
---|---|
addMargin(margin)
Adds the specified margin to this box.
|
|
<static> |
createjs.BoundingBox.clone(box)
Returns a clone of the specified box.
|
contain(x, y)
|
|
containBox(box)
Returns whether this box contains the specified one.
|
|
Returns the height of this bounding box.
|
|
getLeft()
Returns the x position of this bounding box.
|
|
getTop()
Returns the y position of this bounding box.
|
|
getWidth()
Returns the width of this bounding box.
|
|
hasIntersection(box)
Returns whether this box has intersection with the specified one.
|
|
inflate(box)
Inflates this bounding box.
|
|
isDirty(width, height)
Returns whether this box has intersections with the specified rectangle
(0,0)-(width,height).
|
|
isEmpty()
|
|
isEqual(box)
Returns whether this box is an empty one.
|
|
needClip(width, height)
Returns whether this box is a subset of the specified rectangle
(0,0)-(width,height).
|
|
reset()
Resets all properties of this object to the initial state.
|
|
update(x, y)
Updates this bounding box.
|
Field Detail
maxX
The right position of this bounding box.
maxY
The bottom position of this bounding box.
minX
The left position of this bounding box.
minY
The top position of this bounding box.
Method Detail
addMargin(margin)
Adds the specified margin to this box.
- Parameters:
- {number} margin
<static>
{createjs.BoundingBox}
createjs.BoundingBox.clone(box)
Returns a clone of the specified box.
- Parameters:
- {createjs.BoundingBox} box
- Returns:
- {createjs.BoundingBox}
contain(x, y)
- Parameters:
- x
- y
{boolean}
containBox(box)
Returns whether this box contains the specified one.
- Parameters:
- {createjs.BoundingBox} box
- Returns:
- {boolean}
{number}
getHeight()
Returns the height of this bounding box.
- Returns:
- {number}
{number}
getLeft()
Returns the x position of this bounding box.
- Returns:
- {number}
{number}
getTop()
Returns the y position of this bounding box.
- Returns:
- {number}
{number}
getWidth()
Returns the width of this bounding box.
- Returns:
- {number}
{boolean}
hasIntersection(box)
Returns whether this box has intersection with the specified one.
- Parameters:
- {createjs.BoundingBox} box
- Returns:
- {boolean}
inflate(box)
Inflates this bounding box.
- Parameters:
- {createjs.BoundingBox} box
{boolean}
isDirty(width, height)
Returns whether this box has intersections with the specified rectangle
(0,0)-(width,height). This method is used by a renderer to determine if it
needs to redraw its objects.
- Parameters:
- {number} width
- {number} height
- Returns:
- {boolean}
isEmpty()
{boolean}
isEqual(box)
Returns whether this box is an empty one.
- Parameters:
- {createjs.BoundingBox} box
- Returns:
- {boolean}
{boolean}
needClip(width, height)
Returns whether this box is a subset of the specified rectangle
(0,0)-(width,height). This method is used by a renderer to calculate its
clipping rectangle.
- Parameters:
- {number} width
- {number} height
- Returns:
- {boolean}
reset()
Resets all properties of this object to the initial state.
update(x, y)
Updates this bounding box.
- Parameters:
- {number} x
- {number} y