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

Rectangle type. More...

#include <Rectangle.hpp>

Public Member Functions

 Rectangle (::Vector2 position, ::Vector2 size)
 
 Rectangle (::Vector2 size)
 
 Rectangle (::Vector4 rect)
 
 Rectangle (const ::Rectangle &rect)
 
 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) const
 Check collision between circle and rectangle. More...
 
bool CheckCollision (::Vector2 point) const
 Check if point is inside rectangle. More...
 
void Draw (::Color color) const
 Draw a color-filled rectangle. More...
 
void Draw (::Vector2 origin, Degree rotation, ::Color color) const
 
void DrawGradient (::Color col1, ::Color col2, ::Color col3, ::Color col4) const
 
void DrawGradientH (::Color color1, ::Color color2) const
 
void DrawGradientV (::Color color1, ::Color color2) const
 
void DrawLines (::Color color) const
 
void DrawLines (::Color color, float lineThick) const
 
void DrawRounded (float roundness, int segments, ::Color color) const
 
void DrawRoundedLines (float roundness, int segments, ::Color color) const
 
void DrawRoundedLines (float roundness, int segments, float lineThick, ::Color color) const
 
Rectangle GetCollision (::Rectangle rec2) const
 Get collision rectangle for two rectangles collision. More...
 
float GetHeight () const
 Retrieves the height value for the object. More...
 
Vector2 GetPosition () const
 
Vector2 GetSize () const
 
float GetWidth () const
 Retrieves the width value for the object. More...
 
float GetX () const
 Retrieves the x value for the object. More...
 
float GetY () const
 Retrieves the y value for the object. More...
 
 operator Vector4 () const
 
Rectangleoperator= (const ::Rectangle &rect)
 
void SetHeight (float value)
 Sets the height value for the object. More...
 
RectangleSetPosition (const ::Vector2 &position)
 
RectangleSetPosition (float newX, float newY)
 
RectangleSetShapesTexture (const ::Texture2D &texture)
 
RectangleSetSize (const ::Vector2 &size)
 
RectangleSetSize (float newWidth, float newHeight)
 
void SetWidth (float value)
 Sets the width value for the object. More...
 
void SetX (float value)
 Sets the x value for the object. More...
 
void SetY (float value)
 Sets the y value for the object. More...
 
Vector4 ToVector4 ()
 

Protected Member Functions

void set (const ::Rectangle &rect)
 

Detailed Description

Rectangle type.

Definition at line 14 of file Rectangle.hpp.

Constructor & Destructor Documentation

◆ Rectangle() [1/9]

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

Definition at line 16 of file Rectangle.hpp.

◆ Rectangle() [2/9]

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

Definition at line 18 of file Rectangle.hpp.

◆ Rectangle() [3/9]

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

Definition at line 19 of file Rectangle.hpp.

◆ Rectangle() [4/9]

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

Definition at line 20 of file Rectangle.hpp.

◆ Rectangle() [5/9]

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

Definition at line 21 of file Rectangle.hpp.

◆ Rectangle() [6/9]

raylib::Rectangle::Rectangle ( )
inline

Definition at line 22 of file Rectangle.hpp.

◆ Rectangle() [7/9]

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

Definition at line 24 of file Rectangle.hpp.

◆ Rectangle() [8/9]

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

Definition at line 26 of file Rectangle.hpp.

◆ Rectangle() [9/9]

raylib::Rectangle::Rectangle ( ::Vector4  rect)
inline

Definition at line 27 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 105 of file Rectangle.hpp.

◆ CheckCollision() [2/3]

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

Check collision between circle and rectangle.

Definition at line 126 of file Rectangle.hpp.

◆ CheckCollision() [3/3]

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

Check if point is inside rectangle.

Definition at line 119 of file Rectangle.hpp.

◆ Draw() [1/2]

void raylib::Rectangle::Draw ( ::Color  color) const
inline

Draw a color-filled rectangle.

Definition at line 50 of file Rectangle.hpp.

◆ Draw() [2/2]

void raylib::Rectangle::Draw ( ::Vector2  origin,
Degree  rotation,
::Color  color 
) const
inline

Definition at line 54 of file Rectangle.hpp.

◆ DrawGradient()

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

Definition at line 68 of file Rectangle.hpp.

◆ DrawGradientH()

void raylib::Rectangle::DrawGradientH ( ::Color  color1,
::Color  color2 
) const
inline

Definition at line 63 of file Rectangle.hpp.

◆ DrawGradientV()

void raylib::Rectangle::DrawGradientV ( ::Color  color1,
::Color  color2 
) const
inline

Definition at line 58 of file Rectangle.hpp.

◆ DrawLines() [1/2]

void raylib::Rectangle::DrawLines ( ::Color  color) const
inline

Definition at line 72 of file Rectangle.hpp.

◆ DrawLines() [2/2]

void raylib::Rectangle::DrawLines ( ::Color  color,
float  lineThick 
) const
inline

Definition at line 77 of file Rectangle.hpp.

◆ DrawRounded()

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

Definition at line 81 of file Rectangle.hpp.

◆ DrawRoundedLines() [1/2]

void raylib::Rectangle::DrawRoundedLines ( float  roundness,
int  segments,
::Color  color 
) const
inline

Definition at line 85 of file Rectangle.hpp.

◆ DrawRoundedLines() [2/2]

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

Definition at line 93 of file Rectangle.hpp.

◆ GetCollision()

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

Get collision rectangle for two rectangles collision.

Definition at line 112 of file Rectangle.hpp.

◆ GetHeight()

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

Retrieves the height value for the object.

Returns
The height value of the object.

Definition at line 32 of file Rectangle.hpp.

◆ GetPosition()

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

Definition at line 149 of file Rectangle.hpp.

◆ GetSize()

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

Definition at line 130 of file Rectangle.hpp.

◆ GetWidth()

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

Retrieves the width value for the object.

Returns
The width value of the object.

Definition at line 31 of file Rectangle.hpp.

◆ GetX()

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

Retrieves the x value for the object.

Returns
The x value of the object.

Definition at line 29 of file Rectangle.hpp.

◆ GetY()

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

Retrieves the y value for the object.

Returns
The y value of the object.

Definition at line 30 of file Rectangle.hpp.

◆ operator Vector4()

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

Definition at line 43 of file Rectangle.hpp.

◆ operator=()

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

Definition at line 34 of file Rectangle.hpp.

◆ set()

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

Definition at line 164 of file Rectangle.hpp.

◆ SetHeight()

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

Sets the height value for the object.

Parameters
valueThe value of which to set height to.

Definition at line 32 of file Rectangle.hpp.

◆ SetPosition() [1/2]

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

Definition at line 159 of file Rectangle.hpp.

◆ SetPosition() [2/2]

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

Definition at line 153 of file Rectangle.hpp.

◆ SetShapesTexture()

Rectangle & raylib::Rectangle::SetShapesTexture ( const ::Texture2D &  texture)
inline

Definition at line 144 of file Rectangle.hpp.

◆ SetSize() [1/2]

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

Definition at line 140 of file Rectangle.hpp.

◆ SetSize() [2/2]

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

Definition at line 134 of file Rectangle.hpp.

◆ SetWidth()

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

Sets the width value for the object.

Parameters
valueThe value of which to set width to.

Definition at line 31 of file Rectangle.hpp.

◆ SetX()

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

Sets the x value for the object.

Parameters
valueThe value of which to set x to.

Definition at line 29 of file Rectangle.hpp.

◆ SetY()

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

Sets the y value for the object.

Parameters
valueThe value of which to set y to.

Definition at line 30 of file Rectangle.hpp.

◆ ToVector4()

Vector4 raylib::Rectangle::ToVector4 ( )
inline

Definition at line 39 of file Rectangle.hpp.