| Constructor and Description |
|---|
Rectangle(float x,
float y,
float x2,
float y2)
Creates a new
Rectangle with the given coordinates. |
Rectangle(Region src) |
| Modifier and Type | Method and Description |
|---|---|
float |
area()
The total area of this region.
|
Region |
bounds()
Instances of
Region will always return themselves from their bounds implementations. |
float |
by()
The bottom edge of this region.
|
static boolean |
contains(Region query,
Region r)
Returns true only if
r is entirely contained within query. |
float |
endxpos() |
float |
endypos() |
float |
height()
The total height of this region.
|
static Rectangle |
intersection(Region... regions)
Returns a Rectangle that is the
intersection of
start and all of the remaining provided Regions,
or null if there is no common intersection. |
static boolean |
intersects(Region r1,
Region r2)
Returns true only if any portion of the two Regions intersect.
|
float |
lx()
The left edge of this region.
|
float |
rx()
The right edge of this region.
|
String |
toString() |
float |
ty()
The top edge of this region.
|
static Rectangle |
union(Region... regions)
Returns a
Rectangle whose coordinates represent the minimum bounding rectangle of all of the
provided rectangles. |
float |
width()
The width of this region.
|
float |
xpos() |
float |
ypos() |
public Rectangle(float x,
float y,
float x2,
float y2)
Rectangle with the given coordinates. Note that the coordinates are assigned such that
lx <= rx and by <= ty. So, e.g. x2 could be assigned to Rectangle.rx() or
Rectangle.lx().public Rectangle(Region src)
public final float width()
Regionpublic final float height()
Regionpublic final float area()
Regionpublic Region bounds()
RegionRegion will always return themselves from their bounds implementations.public float lx()
Regionpublic float rx()
Regionpublic float by()
Regionpublic float ty()
Regionpublic static boolean intersects(Region r1, Region r2)
public static boolean contains(Region query, Region r)
r is entirely contained within query.public static final Rectangle union(Region... regions)
Rectangle whose coordinates represent the minimum bounding rectangle of all of the
provided rectangles.IllegalArgumentException - if no regions are providedpublic static Rectangle intersection(Region... regions)
start and all of the remaining provided Regions,
or null if there is no common intersection.IllegalArgumentException - if no regions are provided