⚠️ This documentation corresponds to the latest development branch of axmol. It might diverge from the official releases.
|
Axmol Engine 3.0.0-c90f029
|
Rectangle area. More...
#include <Rect.h>
Public Member Functions | |
| constexpr | Rect () |
| Constructor an empty Rect. | |
| constexpr | Rect (float x, float y, float width, float height) |
| Constructor a rect. | |
| constexpr | Rect (const Vec2 &pos, const Vec2 &dimension) |
| Constructor a rect. | |
| constexpr | Rect (const Rect &other) |
| Copy constructor. | |
| Rect & | operator= (const Rect &other) |
| @lua NA | |
| constexpr void | setRect (float x, float y, float width, float height) |
| Set the x, y, width and height of Rect. | |
| float | getMinX () const |
| Get the left of the rect. | |
| float | getMidX () const |
| Get the X coordinate of center point. | |
| float | getMaxX () const |
| Get the right of rect. | |
| float | getMinY () const |
| Get the bottom of rect. | |
| float | getMidY () const |
| Get the Y coordinate of center point. | |
| float | getMaxY () const |
| Get top of rect. | |
| bool | equals (const Rect &rect) const |
| Compare two rects. | |
| bool | containsPoint (const Vec2 &point) const |
| Check if the points is contained in the rect. | |
| bool | intersectsRect (const Rect &rect) const |
| Check the intersect status of two rects. | |
| bool | intersectsCircle (const Vec2 ¢er, float radius) const |
| Check the intersect status of the rect and a circle. | |
| Rect | unionWithRect (const Rect &rect) const |
| Get the min rect which can contain this and rect. | |
| void | merge (const Rect &rect) |
| Compute the min rect which can contain this and rect, assign it to this. | |
Public Attributes | |
| Vec2 | origin |
| Low left point of rect. | |
| Vec2 | size |
| Width and height of the rect. | |
Static Public Attributes | |
| static const Rect | ZERO |
| An empty Rect. | |
Rectangle area.
|
inlineconstexpr |
Set the x, y, width and height of Rect.
@lua NA
|
inline |
Get the left of the rect.
return the leftmost x-value of current rect
|
inline |
Get the X coordinate of center point.
return the midpoint x-value of current rect
|
inline |
Get the right of rect.
return the rightmost x-value of current rect
|
inline |
Get the bottom of rect.
return the bottommost y-value of current rect
|
inline |
Get the Y coordinate of center point.
return the midpoint y-value of current rect
|
inline |
Get top of rect.
return the topmost y-value of current rect
Get the min rect which can contain this and rect.
@lua NA