Class blade.core.screen.ClipRegion
Object
|
+--blade.core.screen.ClipRegion
- class
blade.core.screen.ClipRegion
A rectangular region. Performs checks to keep coordinates within its bounds.
Defined in dragdrop.js
See:
Method Summary |
function
|
bound(position1)
Bounds a position to be within the boundary box
|
function
|
check(position)
Checks whether a coordinate is inside the boundary box
|
function
|
setBounds(upper, lower)
Sets the boundary box
|
blade.core.screen.ClipRegion
function blade.core.screen.ClipRegion(upper, lower, x, y)
Parameters:
upper
- either a Coordinate representing the upper left corner, or the upper-left corner's X coordinate
lower
- either a Coordinate representing the lower right corner, or the upper-left corner's Y coordinate
x
- if upper and lower are numbers instead of Coordinates, the lower right corner's X coordinate
y
- if upper and lower are numbers instead of Coordinates, the lower right corner's Y coordinate
bound
function bound(position1)
Bounds a position to be within the boundary box
Parameters:
position1
- a position to bound
Returns:
a new Coordinate object representing a best-guess at moving position1 back within the boundary box.
check
function check(position)
Checks whether a coordinate is inside the boundary box
Parameters:
position
- a Coordinate object to check
Returns:
true if position inside the boundary box (inclusive), false otherwise
setBounds
function setBounds(upper, lower)
Parameters:
upper
- a Coordinate object representing the upper left corner
lower
- a Coordinate object representing the lower right corner