 |
raylib-cpp
C++ object-oriented wrapper library for raylib.
|
25 #ifndef RAYLIB_CPP_INCLUDE_RECTANGLE_HPP_
26 #define RAYLIB_CPP_INCLUDE_RECTANGLE_HPP_
28 #include "./raylib.hpp"
29 #include "./raylib-cpp-utils.hpp"
30 #include "./Vector2.hpp"
45 GETTERSETTER(
float, X, x)
46 GETTERSETTER(
float, Y, y)
47 GETTERSETTER(
float, Width, width)
48 GETTERSETTER(
float, Height, height)
64 ::DrawRectangle(
static_cast<int>(x),
static_cast<int>(y),
static_cast<int>(width),
65 static_cast<int>(height), color);
70 ::DrawRectanglePro(*
this, origin, rotation, color);
75 ::DrawRectangleGradientV(
static_cast<int>(x),
static_cast<int>(y),
static_cast<int>(width),
76 static_cast<int>(height), color1, color2);
81 ::DrawRectangleGradientH(
static_cast<int>(x),
static_cast<int>(y),
static_cast<int>(width),
82 static_cast<int>(height), color1, color2);
87 ::DrawRectangleGradientEx(*
this, col1, col2, col3, col4);
92 ::DrawRectangleLines(
static_cast<int>(x),
static_cast<int>(y),
static_cast<int>(width),
93 static_cast<int>(height), color);
98 ::DrawRectangleLinesEx(*
this, lineThick, color);
103 ::DrawRectangleRounded(*
this, roundness, segments, color);
109 ::DrawRectangleRoundedLines(*
this, roundness, segments, lineThick, color);
117 return ::CheckCollisionRecs(*
this, rec2);
124 return ::GetCollisionRec(*
this, rec2);
131 return ::CheckCollisionPointRec(point, *
this);
138 return ::CheckCollisionCircleRec(center, radius, *
this);
146 height = rect.height;
151 #endif // RAYLIB_CPP_INCLUDE_RECTANGLE_HPP_
Provides all the classes associated with raylib-cpp.
Rectangle & DrawRounded(float roundness, int segments, ::Color color)
void set(::Rectangle rect)
Rectangle & DrawGradientH(::Color color1, ::Color color2)
Rectangle & Draw(::Vector2 origin, float rotation, ::Color color)
Rectangle & DrawLinesEx(int lineThick, ::Color color)
Rectangle & DrawGradientV(::Color color1, ::Color color2)
Rectangle & DrawLines(::Color color)
bool CheckCollision(::Vector2 point) const
Check if point is inside rectangle.
bool CheckCollision(::Vector2 center, float radius)
Check collision between circle and rectangle.
Rectangle(::Rectangle vec)
Rectangle(float x, float y, float width)
inline ::Rectangle GetCollision(::Rectangle rec2) const
Get collision rectangle for two rectangles collision.
Rectangle(float x, float y)
Rectangle(float x, float y, float width, float height)
Rectangle & DrawGradient(::Color col1, ::Color col2, ::Color col3, ::Color col4)
bool CheckCollision(::Rectangle rec2) const
Check collision between two rectangles.
Rectangle & Draw(::Color color)
Draw a color-filled rectangle.
Rectangle & DrawRoundedLines(float roundness, int segments, int lineThick, ::Color color)
Rectangle & operator=(const Rectangle &rect)