public class RectI
extends java.lang.Object
| Constructor and Description |
|---|
RectI(int width,
int height) |
RectI(int x,
int y,
int width,
int height) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(RectI rect)
Check if this rectangle contains another rectangle.
|
int |
getArea() |
int |
getHeight() |
int |
getWidth() |
int |
getX() |
int |
getY() |
RectI |
intersection(RectI rect)
Get the intersection of this rectangle with another rectangle.
|
boolean |
intersects(RectI rect)
Check if this rectangle intersects with another rectangle.
|
boolean |
isSquare() |
RectI |
scale(int scale)
Scale the rectangle by the same factor in both directions.
|
RectI |
scale(int scaleX,
int scaleY)
Scale the rectangle by different factors in both directions.
|
RectI |
translate(int x,
int y)
Translate the rectangle by the given values.
|
public static final RectI ZERO
public RectI(int width,
int height)
public RectI(int x,
int y,
int width,
int height)
public int getX()
public int getY()
public int getWidth()
public int getHeight()
public RectI translate(int x, int y)
x - The x translationy - The y translationpublic int getArea()
public boolean isSquare()
public RectI scale(int scale)
scale - The scale factorpublic RectI scale(int scaleX, int scaleY)
scaleX - The scale factor for the x directionscaleY - The scale factor for the y directionpublic boolean intersects(RectI rect)
rect - The other rectanglepublic boolean contains(RectI rect)
rect - The other rectangle