| Modifier and Type | Field and Description |
|---|---|
| public float | |
| private static final long | |
| public static final Rectangle | tmp
Static temporary rectangle. |
| public static final Rectangle | tmp2
Static temporary rectangle. |
| public float | |
| public float | |
| public float |
| Access | Constructor and Description |
|---|---|
| public | |
| public | Rectangle(float
The corner point x-coordinate x, float The corner point y-coordinate y, float The width width, float The height height)Constructs a new rectangle with the given corner point in the bottom left and dimensions. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public float | |
| public boolean | Returns: whether the point is contained in the rectanglepoint x coordinate x, float point y coordinate y)Implements com. Returns whether a point with the given coordinates is contained within the shape. |
| public boolean | Returns: whether the point is contained in the rectangleThe coordinates vector point)Implements com. Returns whether the given point is contained within the shape. |
| public boolean | |
| public boolean | |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public Rectangle | |
| public Rectangle | Returns: this rectangle for chainingthe other rectangle to fit this rectangle around rect)Fits this rectangle around another rectangle while maintaining aspect ratio. |
| public Rectangle | Returns: this rectangle for chainingthe string. v)Sets this |
| public float | Returns: the aspect ratio of this rectangle. Returns Float.NaN if height is 0 to avoid ArithmeticExceptionCalculates the aspect ratio ( width / height ) of this rectangle |
| public Vector2 | |
| public float | |
| public Vector2 | |
| public Vector2 | |
| public float | |
| public float | |
| public float | |
| public int | |
| public Rectangle | |
| public Rectangle | Returns: this rectangle for chainingthe x coordinate of the point x, float the y coordinate of the point y)Merges this rectangle with a point. |
| public Rectangle | |
| public Rectangle | |
| public boolean | |
| public float | |
| public Rectangle | set(float
bottom-left x coordinate x, float bottom-left y coordinate y, float width width, float height height)Returns: this rectangle for chaining |
| public Rectangle | |
| public Rectangle | Returns: this for chainingthe position's x x, float the position's y y)Moves this rectangle so that its center point is located at a given position |
| public Rectangle | |
| public Rectangle | Returns: this rectangle for chainingThe height height)Sets the height of this rectangle |
| public Rectangle | Returns: this rectangle for chainingThe position vector position)Sets the x and y-coordinates of the bottom left corner from vector |
| public Rectangle | Returns: this rectangle for chainingThe x-coordinate x, float The y-coordinate y)Sets the x and y-coordinates of the bottom left corner |
| public Rectangle | Returns: this rectangle for chainingThe width width, float The height height)Sets the width and height of this rectangle |
| public Rectangle | Returns: this rectangle for chainingThe size sizeXY)Sets the squared size of this rectangle |
| public Rectangle | |
| public Rectangle | Returns: this rectangle for chainingThe x-coordinate x)Sets the x-coordinate of the bottom left corner |
| public Rectangle | Returns: this rectangle for chainingThe y-coordinate y)Sets the y-coordinate of the bottom left corner |
| public String | Returns: a string representation of this object.Overrides java. Converts this |
| height | back to summary |
|---|---|
| public float height | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| tmp | back to summary |
|---|---|
| public static final Rectangle tmp Static temporary rectangle. Use with care! Use only when sure other code will not also use this. | |
| tmp2 | back to summary |
|---|---|
| public static final Rectangle tmp2 Static temporary rectangle. Use with care! Use only when sure other code will not also use this. | |
| width | back to summary |
|---|---|
| public float width | |
| x | back to summary |
|---|---|
| public float x | |
| y | back to summary |
|---|---|
| public float y | |
| Rectangle | back to summary |
|---|---|
| public Rectangle() Constructs a new rectangle with all values set to zero | |
| Rectangle | back to summary |
|---|---|
| public 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 | back to summary |
|---|---|
| public Rectangle(Rectangle rect) Constructs a rectangle based on the given rectangle
| |
| area | back to summary |
|---|---|
| public float area() | |
| contains | back to summary |
|---|---|
| public boolean contains(float x, float y) Implements com. Doc from com. Returns whether a point with the given coordinates is contained within the shape.
| |
| contains | back to summary |
|---|---|
| public boolean contains(Vector2 point) Implements com. Doc from com. Returns whether the given point is contained within the shape.
| |
| contains | back to summary |
|---|---|
public boolean contains(Circle circle)
| |
| contains | back to summary |
|---|---|
| public boolean contains(Rectangle rectangle) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| fitInside | back to summary |
|---|---|
| public Rectangle fitInside(Rectangle rect) Fits this rectangle into another rectangle while maintaining aspect ratio. This scales and centers the rectangle to the other rectangle (e.g. Scaling a texture within a arbitrary cell without squeezing) | |
| fitOutside | back to summary |
|---|---|
| public Rectangle fitOutside(Rectangle rect) Fits this rectangle around another rectangle while maintaining aspect ratio. This scales and centers the rectangle to the other rectangle (e.g. Having a camera translate and scale to show a given area) | |
| fromString | back to summary |
|---|---|
| public Rectangle fromString(String v) Sets this | |
| getAspectRatio | back to summary |
|---|---|
| public float getAspectRatio() Calculates the aspect ratio ( width / height ) of this rectangle
| |
| getCenter | back to summary |
|---|---|
| public Vector2 getCenter(Vector2 vector) Calculates the center of the rectangle. Results are located in the given Vector2 | |
| getHeight | back to summary |
|---|---|
public float getHeight()
| |
| getPosition | back to summary |
|---|---|
| public Vector2 getPosition(Vector2 position) return the Vector2 with coordinates of this rectangle
| |
| getSize | back to summary |
|---|---|
| public Vector2 getSize(Vector2 size) | |
| getWidth | back to summary |
|---|---|
public float getWidth()
| |
| getX | back to summary |
|---|---|
public float getX()
| |
| getY | back to summary |
|---|---|
public float getY()
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| merge | back to summary |
|---|---|
| public Rectangle merge(Rectangle rect) Merges this rectangle with the other rectangle. The rectangle should not have negative width or negative height. | |
| merge | back to summary |
|---|---|
| public Rectangle merge(float x, float y) Merges this rectangle with a point. The rectangle should not have negative width or negative height.
| |
| merge | back to summary |
|---|---|
| public Rectangle merge(Vector2 vec) Merges this rectangle with a point. The rectangle should not have negative width or negative height. | |
| merge | back to summary |
|---|---|
| public Rectangle merge(Vector2[] vecs) Merges this rectangle with a list of points. The rectangle should not have negative width or negative height. | |
| overlaps | back to summary |
|---|---|
| public boolean overlaps(Rectangle r) | |
| perimeter | back to summary |
|---|---|
| public float perimeter() | |
| set | back to summary |
|---|---|
public Rectangle set(float x, float y, float width, float height)
| |
| set | back to summary |
|---|---|
| public Rectangle set(Rectangle rect) Sets the values of the given rectangle to this rectangle. | |
| setCenter | back to summary |
|---|---|
| public Rectangle setCenter(float x, float y) Moves this rectangle so that its center point is located at a given position
| |
| setCenter | back to summary |
|---|---|
| public Rectangle setCenter(Vector2 position) Moves this rectangle so that its center point is located at a given position | |
| setHeight | back to summary |
|---|---|
| public Rectangle setHeight(float height) Sets the height of this rectangle
| |
| setPosition | back to summary |
|---|---|
| public Rectangle setPosition(Vector2 position) Sets the x and y-coordinates of the bottom left corner from vector | |
| setPosition | back to summary |
|---|---|
| public Rectangle setPosition(float x, float y) Sets the x and y-coordinates of the bottom left corner
| |
| setSize | back to summary |
|---|---|
| public Rectangle setSize(float width, float height) Sets the width and height of this rectangle
| |
| setSize | back to summary |
|---|---|
| public Rectangle setSize(float sizeXY) Sets the squared size of this rectangle
| |
| setWidth | back to summary |
|---|---|
| public Rectangle setWidth(float width) Sets the width of this rectangle
| |
| setX | back to summary |
|---|---|
| public Rectangle setX(float x) Sets the x-coordinate of the bottom left corner
| |
| setY | back to summary |
|---|---|
| public Rectangle setY(float y) Sets the y-coordinate of the bottom left corner
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Converts this
| |