public class Rectangle
extends com.badlogic.gdx.math.Rectangle
Constructor and Description |
---|
Rectangle()
Constructor.
|
Rectangle(float x,
float y,
float width,
float height)
Constructor
|
Modifier and Type | Method and Description |
---|---|
float |
getCenterX()
Returns the center x coordinate of the
Rectangle |
float |
getCenterY()
Returns the center y coordiante of the
Rectangle |
float |
getMaxX()
Returns the x coordinate of the right side of this
Rectangle |
float |
getMaxY()
Returns the y coordinate of the bottom side of this
Rectangle |
boolean |
intersects(Rectangle rect)
Returns if another
Rectangle intersects this one |
void |
set(float x,
float y,
float width,
float height) |
void |
set(com.badlogic.gdx.math.Rectangle rectangle) |
void |
setCenterX(float x)
|
void |
setCenterY(float y)
|
void |
setHeight(float height) |
void |
setWidth(float width) |
void |
setX(float x) |
void |
setY(float y) |
public Rectangle()
Rectangle
at 0,0 with a width and height
of 1public boolean intersects(Rectangle rect)
Rectangle
intersects this onerect
- The Rectangle
to check if it intersects this onepublic void setX(float x)
setX
in class com.badlogic.gdx.math.Rectangle
public void setY(float y)
setY
in class com.badlogic.gdx.math.Rectangle
public void setWidth(float width)
setWidth
in class com.badlogic.gdx.math.Rectangle
public void setHeight(float height)
setHeight
in class com.badlogic.gdx.math.Rectangle
public void set(com.badlogic.gdx.math.Rectangle rectangle)
set
in class com.badlogic.gdx.math.Rectangle
public void set(float x, float y, float width, float height)
set
in class com.badlogic.gdx.math.Rectangle
public float getCenterX()
Rectangle
public void setCenterX(float x)
Rectangle
and recalculates
the x and maxX coordinates based on the width of Rectangle
x
- public float getCenterY()
Rectangle
public void setCenterY(float y)
Rectangle
and recalculates
the y and maxY coordinates based on the height of the Rectangle
y
- public float getMaxX()
Rectangle
public float getMaxY()
Rectangle
Copyright © 2014. All rights reserved.