Added vector2 based constructors to rect2.

This commit is contained in:
Relintai 2022-02-04 11:30:01 +01:00
parent a723d748a7
commit e9250d185f
2 changed files with 8 additions and 0 deletions

View File

@ -205,3 +205,10 @@ Rect2::Rect2(const float rx, const float ry, const float rw, const float rh) {
w = rw;
h = rh;
}
Rect2::Rect2(const Vector2 &position, const Vector2 &size) {
x = position.x;
y = position.y;
w = size.x;
h = size.y;
}

View File

@ -40,6 +40,7 @@ public:
Rect2(const Rect2 &b);
Rect2(const float rx, const float ry);
Rect2(const float rx, const float ry, const float rw, const float rh);
Rect2(const Vector2 &position, const Vector2 &size);
float x;
float y;