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

Public Member Functions

 Rectangle ()
 
 Rectangle (::Vector2 position, ::Vector2 size)
 
 Rectangle (::Vector2 size)
 
 Rectangle (const ::Rectangle &vec)
 
 Rectangle (float x)
 
 Rectangle (float x, float y)
 
 Rectangle (float x, float y, float width)
 
 Rectangle (float x, float y, float width, float height)
 
bool CheckCollision (::Rectangle rec2) const
 Check collision between two rectangles. More...
 
bool CheckCollision (::Vector2 center, float radius)
 Check collision between circle and rectangle. More...
 
bool CheckCollision (::Vector2 point) const
 Check if point is inside rectangle. More...
 
Rectangle & Draw (::Color color)
 Draw a color-filled rectangle. More...
 
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 & DrawLines (::Color color, int lineThick)
 
Rectangle & DrawRounded (float roundness, int segments, ::Color color)
 
Rectangle & DrawRoundedLines (float roundness, int segments, int lineThick, ::Color color)
 
inline ::Rectangle GetCollision (::Rectangle rec2) const
 Get collision rectangle for two rectangles collision. More...
 
float GetHeight () const
 
inline ::Vector2 GetPosition ()
 
inline ::Vector2 GetSize ()
 
float GetWidth () const
 
float GetX () const
 
float GetY () const
 
 operator::Vector4 () const
 
Rectangle & operator= (const ::Rectangle &rect)
 
void SetHeight (float value)
 
Rectangle & SetPosition (const ::Vector2 &position)
 
Rectangle & SetPosition (float newX, float newY)
 
Rectangle & SetSize (const ::Vector2 &size)
 
Rectangle & SetSize (float newWidth, float newHeight)
 
void SetWidth (float value)
 
void SetX (float value)
 
void SetY (float value)
 
inline ::Vector4 ToVector4 ()
 

Protected Member Functions

void set (const ::Rectangle &rect)
 

Detailed Description

Definition at line 33 of file Rectangle.hpp.

Constructor & Destructor Documentation

◆ Rectangle() [1/8]

raylib::Rectangle::Rectangle ( const ::Rectangle &  vec)
inline

Definition at line 35 of file Rectangle.hpp.

References set().

◆ Rectangle() [2/8]

raylib::Rectangle::Rectangle ( float  x,
float  y,
float  width,
float  height 
)
inline

Definition at line 39 of file Rectangle.hpp.

◆ Rectangle() [3/8]

raylib::Rectangle::Rectangle ( float  x,
float  y,
float  width 
)
inline

Definition at line 40 of file Rectangle.hpp.

◆ Rectangle() [4/8]

raylib::Rectangle::Rectangle ( float  x,
float  y 
)
inline

Definition at line 41 of file Rectangle.hpp.

◆ Rectangle() [5/8]

raylib::Rectangle::Rectangle ( float  x)
inline

Definition at line 42 of file Rectangle.hpp.

◆ Rectangle() [6/8]

raylib::Rectangle::Rectangle ( )
inline

Definition at line 43 of file Rectangle.hpp.

◆ Rectangle() [7/8]

raylib::Rectangle::Rectangle ( ::Vector2  position,
::Vector2  size 
)
inline

Definition at line 45 of file Rectangle.hpp.

◆ Rectangle() [8/8]

raylib::Rectangle::Rectangle ( ::Vector2  size)
inline

Definition at line 47 of file Rectangle.hpp.

Member Function Documentation

◆ CheckCollision() [1/3]

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

Check collision between two rectangles.

Definition at line 123 of file Rectangle.hpp.

◆ CheckCollision() [2/3]

bool raylib::Rectangle::CheckCollision ( ::Vector2  center,
float  radius 
)
inline

Check collision between circle and rectangle.

Definition at line 144 of file Rectangle.hpp.

◆ CheckCollision() [3/3]

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

Check if point is inside rectangle.

Definition at line 137 of file Rectangle.hpp.

◆ Draw() [1/2]

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

Draw a color-filled rectangle.

Definition at line 70 of file Rectangle.hpp.

◆ Draw() [2/2]

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

Definition at line 76 of file Rectangle.hpp.

◆ DrawGradient()

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

Definition at line 93 of file Rectangle.hpp.

◆ DrawGradientH()

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

Definition at line 87 of file Rectangle.hpp.

◆ DrawGradientV()

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

Definition at line 81 of file Rectangle.hpp.

◆ DrawLines() [1/2]

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

Definition at line 98 of file Rectangle.hpp.

◆ DrawLines() [2/2]

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

Definition at line 104 of file Rectangle.hpp.

◆ DrawRounded()

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

Definition at line 109 of file Rectangle.hpp.

◆ DrawRoundedLines()

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

Definition at line 114 of file Rectangle.hpp.

◆ GetCollision()

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

Get collision rectangle for two rectangles collision.

Definition at line 130 of file Rectangle.hpp.

◆ GetHeight()

float raylib::Rectangle::GetHeight ( ) const
inline

Definition at line 52 of file Rectangle.hpp.

◆ GetPosition()

inline ::Vector2 raylib::Rectangle::GetPosition ( )
inline

Definition at line 162 of file Rectangle.hpp.

◆ GetSize()

inline ::Vector2 raylib::Rectangle::GetSize ( )
inline

Definition at line 148 of file Rectangle.hpp.

◆ GetWidth()

float raylib::Rectangle::GetWidth ( ) const
inline

Definition at line 51 of file Rectangle.hpp.

◆ GetX()

float raylib::Rectangle::GetX ( ) const
inline

Definition at line 49 of file Rectangle.hpp.

◆ GetY()

float raylib::Rectangle::GetY ( ) const
inline

Definition at line 50 of file Rectangle.hpp.

◆ operator::Vector4()

raylib::Rectangle::operator::Vector4 ( ) const
inline

Definition at line 63 of file Rectangle.hpp.

◆ operator=()

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

Definition at line 54 of file Rectangle.hpp.

References set().

◆ set()

void raylib::Rectangle::set ( const ::Rectangle &  rect)
inlineprotected

Definition at line 177 of file Rectangle.hpp.

Referenced by operator=(), and Rectangle().

◆ SetHeight()

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

Definition at line 52 of file Rectangle.hpp.

◆ SetPosition() [1/2]

Rectangle& raylib::Rectangle::SetPosition ( const ::Vector2 &  position)
inline

Definition at line 172 of file Rectangle.hpp.

References SetPosition().

◆ SetPosition() [2/2]

Rectangle& raylib::Rectangle::SetPosition ( float  newX,
float  newY 
)
inline

Definition at line 166 of file Rectangle.hpp.

Referenced by SetPosition().

◆ SetSize() [1/2]

Rectangle& raylib::Rectangle::SetSize ( const ::Vector2 &  size)
inline

Definition at line 158 of file Rectangle.hpp.

References SetSize().

◆ SetSize() [2/2]

Rectangle& raylib::Rectangle::SetSize ( float  newWidth,
float  newHeight 
)
inline

Definition at line 152 of file Rectangle.hpp.

Referenced by SetSize().

◆ SetWidth()

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

Definition at line 51 of file Rectangle.hpp.

◆ SetX()

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

Definition at line 49 of file Rectangle.hpp.

◆ SetY()

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

Definition at line 50 of file Rectangle.hpp.

◆ ToVector4()

inline ::Vector4 raylib::Rectangle::ToVector4 ( )
inline

Definition at line 59 of file Rectangle.hpp.