public interface Area
| Modifier and Type | Method and Description |
|---|---|
Area |
copyOf()
Clone our area.
|
int |
distanceToEdge(Location location)
Determine the shortest distance from the location to the edge of the area.
|
int |
getBottom()
Get the area's bottom coordinate in pixels.
|
Location |
getCenter()
Get the area's center Location.
|
int |
getHeight()
Get the area's height.
|
int |
getLeft()
Get the area's left coordinate in pixels.
|
int |
getRight()
Get the area's right coordinate in pixels.
|
int |
getSize()
Determine area (width * height).
|
int |
getTop()
Get the area's top coordinate in pixels.
|
int |
getWidth()
Get the area's width.
|
boolean |
inBottomLeft(Location location)
Determine if location is to the bottom-left of the area diagonal.
|
boolean |
inBottomRight(Location location)
Determine if location is to the bottom-right of the area diagonal.
|
boolean |
intersects(Area targetArea)
Determine if the target area intersects our area.
|
boolean |
intersects(Location location)
Determine if the provided location intersects with our area.
|
void |
moveTo(Location location)
Translate our top left position to the new location.
|
Area copyOf()
int distanceToEdge(Location location)
location - the reference locationint getBottom()
Location getCenter()
int getHeight()
int getLeft()
int getRight()
int getSize()
int getTop()
int getWidth()
boolean inBottomRight(Location location)
| /
/
+-----------------+-----------------+
| area / |
| | / |
| / |
| | / |
| / |
- - - + - - - - - - - - + - - - - - - - - + - - - x-axis
| / |
| / | |
| / |
| / | |
| / |
+-----------------+-----------------+
/
/ |
y-axis
location - the location to considerboolean inBottomLeft(Location location)
\ |
\
+-----------------+-----------------+
| \ area |
| \ | |
| \ |
| \ | |
| \ |
- - - + - - - - - - - - + - - - - - - - - + - - - x-axis
| \ |
| | \ |
| \ |
| | \ |
| \ |
+-----------------+-----------------+
\
| \
y-axis
location - the location to considerboolean intersects(Area targetArea)
targetArea - the area to compare toboolean intersects(Location location)
location - the location to examinevoid moveTo(Location location)
location - the position to translate to