|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.math.Rectangle
public class Rectangle
Encapsulates a 2D rectangle defined by it's bottom corner point and its extends in x (width) and y (height).
Field Summary | |
---|---|
float |
height
|
float |
width
|
float |
x
|
float |
y
|
Constructor Summary | |
---|---|
Rectangle()
Constructs a new rectangle with all values set to zero |
|
Rectangle(float x,
float y,
float width,
float height)
Constructs a new rectangle with the given corner point in the bottom left and dimensions. |
|
Rectangle(Rectangle rect)
Constructs a rectangle based on the given rectangle |
Method Summary | |
---|---|
boolean |
contains(float x,
float y)
|
boolean |
contains(Rectangle rectangle)
|
float |
getHeight()
|
float |
getWidth()
|
float |
getX()
|
float |
getY()
|
void |
merge(Rectangle rect)
Merges this rectangle with the other rectangle. |
boolean |
overlaps(Rectangle rectangle)
|
void |
set(float x,
float y,
float width,
float height)
|
void |
set(Rectangle rect)
Sets the values of the given rectangle to this rectangle. |
void |
setHeight(float height)
Sets the height of this rectangle |
void |
setWidth(float width)
Sets the width of this rectangle |
void |
setX(float x)
Sets the x-coordinate of the bottom left corner |
void |
setY(float y)
Sets the y-coordinate of the bottom left corner |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public float x
public float y
public float width
public float height
Constructor Detail |
---|
public Rectangle()
public Rectangle(float x, float y, float width, float height)
x
- The corner point x-coordinatey
- The corner point y-coordinatewidth
- The widthheight
- The heightpublic Rectangle(Rectangle rect)
rect
- The rectangleMethod Detail |
---|
public float getX()
public void setX(float x)
x
- The x-coordinatepublic float getY()
public void setY(float y)
y
- The y-coordinatepublic float getWidth()
public void setWidth(float width)
width
- The widthpublic float getHeight()
public void setHeight(float height)
height
- The heightpublic boolean contains(Rectangle rectangle)
rectangle
- the other Rectangle
.
public boolean overlaps(Rectangle rectangle)
rectangle
- the other Rectangle
public void set(float x, float y, float width, float height)
public boolean contains(float x, float y)
x
- point x coordinatey
- point y coordinate
public void set(Rectangle rect)
rect
- the other rectanglepublic void merge(Rectangle rect)
rect
- the other rectanglepublic java.lang.String toString()
toString
in class java.lang.Object
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |