java.lang.Object | |
↳ | com.neomades.graphics.Rect |
Rect holds four int coordinates for a rectangle area. The four coordinates are position: x, y and dimension: w (width), h (height).
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public int | h | Height of the rectangle | |||||||||
public int | w | Width of the rectangle | |||||||||
public int | x | X-position | |||||||||
public int | y | Y-position |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Rect()
Constructs a new Rectangle, with all values to 0 (x, y, width and height)
| |||||||||||
Rect(int x, int y, int w, int h)
Constructs a new rectangle, given the x, y, width and height.
| |||||||||||
Rect(Rect collision)
Create a rectangle from an other rectangle.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int |
bottom()
Gets the bottom position of the rectangle (y + height).
| ||||||||||
int |
left()
Gets the left position of the rectangle (x)
| ||||||||||
int |
right()
Gets the right position of the rectangle (x + width).
| ||||||||||
int |
top()
Gets the top position of the rectangle (y)
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Height of the rectangle
Width of the rectangle
X-position
Y-position
Constructs a new Rectangle, with all values to 0 (x, y, width and height)
Constructs a new rectangle, given the x, y, width and height.
x | x position |
---|---|
y | y position |
w | width |
h | height |
Create a rectangle from an other rectangle.
collision | the rectangle to create |
---|
Gets the bottom position of the rectangle (y + height).
Gets the left position of the rectangle (x)
Gets the right position of the rectangle (x + width).
Gets the top position of the rectangle (y)