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

Rectangle type. More...

Public Member Functions

 Rectangle (::Vector2 position, ::Vector2 size)
 
 Rectangle (::Vector2 size)
 
 Rectangle (::Vector4 rect)
 
 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.
 
bool CheckCollision (::Vector2 center, float radius)
 Check collision between circle and rectangle.
 
bool CheckCollision (::Vector2 point) const
 Check if point is inside rectangle.
 
RectangleDraw (::Color color)
 Draw a color-filled rectangle.
 
RectangleDraw (::Vector2 origin, float rotation, ::Color color)
 
RectangleDrawGradient (::Color col1, ::Color col2, ::Color col3, ::Color col4)
 
RectangleDrawGradientH (::Color color1, ::Color color2)
 
RectangleDrawGradientV (::Color color1, ::Color color2)
 
RectangleDrawLines (::Color color)
 
RectangleDrawLines (::Color color, float lineThick)
 
RectangleDrawRounded (float roundness, int segments, ::Color color)
 
RectangleDrawRoundedLines (float roundness, int segments, float lineThick, ::Color color)
 
inline ::Rectangle GetCollision (::Rectangle rec2) const
 Get collision rectangle for two rectangles collision.
 
float GetHeight () const
 Retrieves the height value for the object. More...
 
inline ::Vector2 GetPosition ()
 
inline ::Vector2 GetSize ()
 
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...
 
inline ::Vector4 ToVector4 ()
 

Detailed Description

Rectangle type.

Definition at line 12 of file Rectangle.hpp.

Member Function Documentation

◆ 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.

◆ 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.

◆ 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.

◆ 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.