raylib-cpp
C++ object-oriented wrapper library for raylib.
Public Member Functions | List of all members
raylib::Rectangle Class Reference

Public Member Functions

 Rectangle (::Rectangle vec)
 
 Rectangle (float X=0, float Y=0, float Width=0, float Height=0)
 
bool CheckCollision (::Rectangle rec2)
 
bool CheckCollision (::Vector2 point)
 
Rectangle & Draw (::Color color)
 
Rectangle & Draw (::Vector2 origin, float rotation, ::Color color)
 
Rectangle & DrawGradient (::Color col1, ::Color col2, ::Color col3, ::Color col4)
 
Rectangle & DrawGradientH (::Color color1, ::Color color2)
 
Rectangle & DrawGradientV (::Color color1, ::Color color2)
 
Rectangle & DrawLines (::Color color)
 
Rectangle & DrawLinesEx (int lineThick, ::Color color)
 
Rectangle & DrawRounded (float roundness, int segments, ::Color color)
 
Rectangle & DrawRoundedLines (float roundness, int segments, int lineThick, ::Color color)
 
Rectangle GetCollision (::Rectangle rec2)
 
float GetHeight ()
 
float GetWidth ()
 
float GetX ()
 
float GetY ()
 
Rectangle & operator= (const ::Rectangle &rect)
 
Rectangle & operator= (const Rectangle &rect)
 
void set (::Rectangle rect)
 
void SetHeight (float value)
 
void SetWidth (float value)
 
void SetX (float value)
 
void SetY (float value)
 

Detailed Description

Definition at line 16 of file Rectangle.hpp.

Constructor & Destructor Documentation

◆ Rectangle() [1/2]

raylib::Rectangle::Rectangle ( ::Rectangle  vec)
inline

Definition at line 18 of file Rectangle.hpp.

18  {
19  set(vec);
20  };

◆ Rectangle() [2/2]

raylib::Rectangle::Rectangle ( float  X = 0,
float  Y = 0,
float  Width = 0,
float  Height = 0 
)
inline

Definition at line 21 of file Rectangle.hpp.

21  {
22  x = X;
23  y = Y;
24  width = Width;
25  height = Height;
26  };

Member Function Documentation

◆ CheckCollision() [1/2]

bool raylib::Rectangle::CheckCollision ( ::Rectangle  rec2)
inline

Definition at line 88 of file Rectangle.hpp.

88  {
89  return ::CheckCollisionRecs(*this, rec2);
90  }

◆ CheckCollision() [2/2]

bool raylib::Rectangle::CheckCollision ( ::Vector2  point)
inline

Definition at line 94 of file Rectangle.hpp.

94  {
95  return ::CheckCollisionPointRec(point, *this);
96  }

◆ Draw() [1/2]

Rectangle& raylib::Rectangle::Draw ( ::Color  color)
inline

Definition at line 50 of file Rectangle.hpp.

50  {
51  ::DrawRectangle(static_cast<int>(x), static_cast<int>(y), static_cast<int>(width), static_cast<int>(height), color);
52  return *this;
53  }

◆ Draw() [2/2]

Rectangle& raylib::Rectangle::Draw ( ::Vector2  origin,
float  rotation,
::Color  color 
)
inline

Definition at line 54 of file Rectangle.hpp.

54  {
55  ::DrawRectanglePro(*this, origin, rotation, color);
56  return *this;
57  }

◆ DrawGradient()

Rectangle& raylib::Rectangle::DrawGradient ( ::Color  col1,
::Color  col2,
::Color  col3,
::Color  col4 
)
inline

Definition at line 67 of file Rectangle.hpp.

67  {
68  ::DrawRectangleGradientEx(*this, col1, col2, col3, col4);
69  return *this;
70  }

◆ DrawGradientH()

Rectangle& raylib::Rectangle::DrawGradientH ( ::Color  color1,
::Color  color2 
)
inline

Definition at line 63 of file Rectangle.hpp.

63  {
64  ::DrawRectangleGradientH(static_cast<int>(x), static_cast<int>(y), static_cast<int>(width), static_cast<int>(height), color1, color2);
65  return *this;
66  }

◆ DrawGradientV()

Rectangle& raylib::Rectangle::DrawGradientV ( ::Color  color1,
::Color  color2 
)
inline

Definition at line 59 of file Rectangle.hpp.

59  {
60  ::DrawRectangleGradientH(static_cast<int>(x), static_cast<int>(y), static_cast<int>(width), static_cast<int>(height), color1, color2);
61  return *this;
62  }

◆ DrawLines()

Rectangle& raylib::Rectangle::DrawLines ( ::Color  color)
inline

Definition at line 71 of file Rectangle.hpp.

71  {
72  ::DrawRectangleLines(static_cast<int>(x), static_cast<int>(y), static_cast<int>(width), static_cast<int>(height), color);
73  return *this;
74  }

◆ DrawLinesEx()

Rectangle& raylib::Rectangle::DrawLinesEx ( int  lineThick,
::Color  color 
)
inline

Definition at line 75 of file Rectangle.hpp.

75  {
76  ::DrawRectangleLinesEx(*this, lineThick, color);
77  return *this;
78  }

◆ DrawRounded()

Rectangle& raylib::Rectangle::DrawRounded ( float  roundness,
int  segments,
::Color  color 
)
inline

Definition at line 79 of file Rectangle.hpp.

79  {
80  ::DrawRectangleRounded(*this, roundness, segments, color);
81  return *this;
82  }

◆ DrawRoundedLines()

Rectangle& raylib::Rectangle::DrawRoundedLines ( float  roundness,
int  segments,
int  lineThick,
::Color  color 
)
inline

Definition at line 83 of file Rectangle.hpp.

83  {
84  ::DrawRectangleRoundedLines(*this, roundness, segments, lineThick, color);
85  return *this;
86  }

◆ GetCollision()

Rectangle raylib::Rectangle::GetCollision ( ::Rectangle  rec2)
inline

Definition at line 91 of file Rectangle.hpp.

91  {
92  return ::GetCollisionRec(*this, rec2);
93  }

◆ GetHeight()

float raylib::Rectangle::GetHeight ( )
inline

Definition at line 38 of file Rectangle.hpp.

◆ GetWidth()

float raylib::Rectangle::GetWidth ( )
inline

Definition at line 37 of file Rectangle.hpp.

◆ GetX()

float raylib::Rectangle::GetX ( )
inline

Definition at line 35 of file Rectangle.hpp.

◆ GetY()

float raylib::Rectangle::GetY ( )
inline

Definition at line 36 of file Rectangle.hpp.

◆ operator=() [1/2]

Rectangle& raylib::Rectangle::operator= ( const ::Rectangle &  rect)
inline

Definition at line 40 of file Rectangle.hpp.

40  {
41  set(rect);
42  return *this;
43  }

◆ operator=() [2/2]

Rectangle& raylib::Rectangle::operator= ( const Rectangle &  rect)
inline

Definition at line 45 of file Rectangle.hpp.

45  {
46  set(rect);
47  return *this;
48  }

◆ set()

void raylib::Rectangle::set ( ::Rectangle  rect)
inline

Definition at line 28 of file Rectangle.hpp.

28  {
29  x = rect.x;
30  y = rect.y;
31  width = rect.width;
32  height = rect.height;
33  }

◆ SetHeight()

void raylib::Rectangle::SetHeight ( float  value)
inline

Definition at line 38 of file Rectangle.hpp.

◆ SetWidth()

void raylib::Rectangle::SetWidth ( float  value)
inline

Definition at line 37 of file Rectangle.hpp.

◆ SetX()

void raylib::Rectangle::SetX ( float  value)
inline

Definition at line 35 of file Rectangle.hpp.

◆ SetY()

void raylib::Rectangle::SetY ( float  value)
inline

Definition at line 36 of file Rectangle.hpp.