Raylib C++  1.0.0
Encapsulates the raylib library
Static Public Member Functions | List of all members
raylib::helper::draw::Draw2DHelper Class Reference

Helper class for drawing 2D shapes. More...

#include <Draw2DHelper.hpp>

Collaboration diagram for raylib::helper::draw::Draw2DHelper:
Collaboration graph

Static Public Member Functions

static void setShapesTexture (const texture::RlTexture &texture, const Rectangle &source)
 Set texture and rectangle to be used on shapes drawing NOTE: It can be useful when using basic shapes and one single font, defining a font char white rectangle would allow drawing everything in a single Draw call. More...
 
static void drawPixel (int posX, int posY, const RlColor &color)
 Draw a pixel. More...
 
static void drawPixel (const Vector2f &position, const RlColor &color)
 Draw a pixel. More...
 
static void drawLine (int startPosX, int startPosY, int endPosX, int endPosY, const RlColor &color)
 Draw a line. More...
 
static void drawLine (const Vector2f &startPos, const Vector2f &endPos, const RlColor &color)
 Draw a line. More...
 
static void drawLine (const Vector2f &startPos, const Vector2f &endPos, float thick, const RlColor &color)
 Draw a line. More...
 
static void drawLineBezier (const Vector2f &startPos, const Vector2f &endPos, float thick, const RlColor &color)
 Draw a Line using cubic-bezier curves in-out. More...
 
static void drawLineBezierQuad (const Vector2f &startPos, const Vector2f &endPos, const Vector2f &controlPos, float thick, const RlColor &color)
 Draw a line using quadratic bezier curves with a control point. More...
 
static void drawLineBezierCubic (const Vector2f &startPos, const Vector2f &endPos, const Vector2f &startControlPos, const Vector2f &endControlPos, float thick, const RlColor &color)
 Draw a line using cubic bezier curves with 2 control points. More...
 
static void drawLineStrip (const std::vector< Vector2f > &points, const RlColor &color)
 Draw lines sequence. More...
 
static void drawCircle (int centerX, int centerY, float radius, const RlColor &color)
 Draw a color-filled circle. More...
 
static void drawCircleSector (const Vector2f &center, float radius, float startAngle, float endAngle, int segments, const RlColor &color)
 Draw a piece of a circle. More...
 
static void drawCircleSectorLines (const Vector2f &center, float radius, float startAngle, float endAngle, int segments, const RlColor &color)
 Draw circle sector outline. More...
 
static void drawCircleGradient (int centerX, int centerY, float radius, const RlColor &color1, const RlColor &color2)
 Draw a gradient-filled circle. More...
 
static void drawCircle (const Vector2f &center, float radius, const RlColor &color)
 Draw a color-filled circle. More...
 
static void drawCircleLines (int centerX, int centerY, float radius, const RlColor &color)
 Draw circle outline. More...
 
static void drawEllipse (int centerX, int centerY, float radiusH, float radiusV, const RlColor &color)
 Draw ellipse. More...
 
static void drawEllipseLines (int centerX, int centerY, float radiusH, float radiusV, const RlColor &color)
 Draw ellipse outline. More...
 
static void drawRing (const Vector2f &center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, const RlColor &color)
 Draw a ring. More...
 
static void drawRingLines (const Vector2f &center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, const RlColor &color)
 Draw a ring outline. More...
 
static void drawRectangle (int posX, int posY, int width, int height, const RlColor &color)
 Draw a filled rectangle. More...
 
static void drawRectangle (const Vector2f &position, const Vector2f &size, const RlColor &color)
 Draw a filled rectangle. More...
 
static void drawRectangle (const Rectangle &rec, const RlColor &color)
 Draw a filled rectangle. More...
 
static void drawRectangle (const Rectangle &rec, const Vector2f &origin, float rotation, const RlColor &color)
 Draw a filled rectangle. More...
 
static void drawRectangleGradientV (int posX, int posY, int width, int height, const RlColor &color1, const RlColor &color2)
 Draw a vertical-gradient-filled rectangle. More...
 
static void drawRectangleGradientH (int posX, int posY, int width, int height, const RlColor &color1, const RlColor &color2)
 Draw a horizontal-gradient-filled rectangle. More...
 
static void drawRectangleGradient (const Rectangle &rec, const RlColor &col1, const RlColor &col2, const RlColor &col3, const RlColor &col4)
 Draw a gradient-filled rectangle with custom vertex colors. More...
 
static void drawRectangleLines (int posX, int posY, int width, int height, const RlColor &color)
 Draw rectangle outline. More...
 
static void drawRectangleLinesEx (const Rectangle &rec, float lineThick, const RlColor &color)
 Draw rectangle outline with extended parameters. More...
 
static void drawRectangleRounded (const Rectangle &rec, float roundness, int segments, const RlColor &color)
 Draw rectangle with rounded edges. More...
 
static void drawRectangleRoundedLines (const Rectangle &rec, float roundness, int segments, float lineThick, const RlColor &color)
 Draw rectangle with rounded edges outline. More...
 
static void drawTriangle (const Vector2f &v1, const Vector2f &v2, const Vector2f &v3, const RlColor &color)
 Draw a color-filled triangle (vertex in counter-clockwise order!) More...
 
static void drawTriangleLines (const Vector2f &v1, const Vector2f &v2, const Vector2f &v3, const RlColor &color)
 Draw a triangle outline (vertex in counter-clockwise order!) More...
 
static void drawTriangleFan (const std::vector< Vector2f > &points, const RlColor &color)
 Draw a triangle fan defined by points (first vertex is the center, shared by all triangles) By default, following vertex should be provided in counter-clockwise order. More...
 
static void drawTriangleStrip (const std::vector< Vector2f > &points, const RlColor &color)
 Draw a triangle strip defined by points. More...
 
static void drawPoly (const Vector2f &center, int sides, float radius, float rotation, const RlColor &color)
 Draw a regular polygon (Vector version) More...
 
static void drawPolyLines (const Vector2f &center, int sides, float radius, float rotation, const RlColor &color)
 Draw a polygon outline of n sides. More...
 
static void drawPolyLines (const Vector2f &center, int sides, float radius, float rotation, float lineThick, const RlColor &color)
 Draw a polygon outline of n sides with extended parameters. More...
 

Detailed Description

Helper class for drawing 2D shapes.

Member Function Documentation

◆ drawCircle() [1/2]

void raylib::helper::draw::Draw2DHelper::drawCircle ( const Vector2f center,
float  radius,
const RlColor color 
)
static

Draw a color-filled circle.

Parameters
center
radius
color
Here is the call graph for this function:

◆ drawCircle() [2/2]

void raylib::helper::draw::Draw2DHelper::drawCircle ( int  centerX,
int  centerY,
float  radius,
const RlColor color 
)
static

Draw a color-filled circle.

Parameters
centerXto Draw at
centerYto Draw at
radiusto use
colorto use
Here is the call graph for this function:

◆ drawCircleGradient()

void raylib::helper::draw::Draw2DHelper::drawCircleGradient ( int  centerX,
int  centerY,
float  radius,
const RlColor color1,
const RlColor color2 
)
static

Draw a gradient-filled circle.

Parameters
centerXto Draw at
centerYto Draw at
radiusto use
color1to use
color2to use
Here is the call graph for this function:

◆ drawCircleLines()

void raylib::helper::draw::Draw2DHelper::drawCircleLines ( int  centerX,
int  centerY,
float  radius,
const RlColor color 
)
static

Draw circle outline.

Parameters
centerXto Draw at
centerYto Draw at
radiusto use
colorto use
Here is the call graph for this function:

◆ drawCircleSector()

void raylib::helper::draw::Draw2DHelper::drawCircleSector ( const Vector2f center,
float  radius,
float  startAngle,
float  endAngle,
int  segments,
const RlColor color 
)
static

Draw a piece of a circle.

Parameters
centerto Draw at
radiusto use
startAngleto use
endAngleto use
segmentsto use
colorto use
Here is the call graph for this function:

◆ drawCircleSectorLines()

void raylib::helper::draw::Draw2DHelper::drawCircleSectorLines ( const Vector2f center,
float  radius,
float  startAngle,
float  endAngle,
int  segments,
const RlColor color 
)
static

Draw circle sector outline.

Parameters
centerto Draw at
radiusto use
startAngleto use
endAngleto use
segmentsto use
colorto use
Here is the call graph for this function:

◆ drawEllipse()

void raylib::helper::draw::Draw2DHelper::drawEllipse ( int  centerX,
int  centerY,
float  radiusH,
float  radiusV,
const RlColor color 
)
static

Draw ellipse.

Parameters
centerXto Draw at
centerYto Draw at
radiusHto use
radiusVto use
colorto use
Here is the call graph for this function:

◆ drawEllipseLines()

void raylib::helper::draw::Draw2DHelper::drawEllipseLines ( int  centerX,
int  centerY,
float  radiusH,
float  radiusV,
const RlColor color 
)
static

Draw ellipse outline.

Parameters
centerXto Draw at
centerYto Draw at
radiusHto use
radiusVto use
colorto use
Here is the call graph for this function:

◆ drawLine() [1/3]

void raylib::helper::draw::Draw2DHelper::drawLine ( const Vector2f startPos,
const Vector2f endPos,
const RlColor color 
)
static

Draw a line.

Parameters
startPosto Draw from
endPosto Draw to
colorto use
Here is the call graph for this function:

◆ drawLine() [2/3]

void raylib::helper::draw::Draw2DHelper::drawLine ( const Vector2f startPos,
const Vector2f endPos,
float  thick,
const RlColor color 
)
static

Draw a line.

Parameters
startPosto Draw from
endPosto Draw to
thickto use
colorto use
Here is the call graph for this function:

◆ drawLine() [3/3]

void raylib::helper::draw::Draw2DHelper::drawLine ( int  startPosX,
int  startPosY,
int  endPosX,
int  endPosY,
const RlColor color 
)
static

Draw a line.

Parameters
startPosXto Draw from
startPosYto Draw from
endPosXto Draw to
endPosYto Draw to
colorto use
Here is the call graph for this function:

◆ drawLineBezier()

void raylib::helper::draw::Draw2DHelper::drawLineBezier ( const Vector2f startPos,
const Vector2f endPos,
float  thick,
const RlColor color 
)
static

Draw a Line using cubic-bezier curves in-out.

Parameters
startPosto Draw from
endPosto Draw to
thickto use
colorto use
Here is the call graph for this function:

◆ drawLineBezierCubic()

void raylib::helper::draw::Draw2DHelper::drawLineBezierCubic ( const Vector2f startPos,
const Vector2f endPos,
const Vector2f startControlPos,
const Vector2f endControlPos,
float  thick,
const RlColor color 
)
static

Draw a line using cubic bezier curves with 2 control points.

Parameters
startPosto Draw from
endPosto Draw to
startControlPosto use
endControlPosto use
thickto use
colorto use
Here is the call graph for this function:

◆ drawLineBezierQuad()

void raylib::helper::draw::Draw2DHelper::drawLineBezierQuad ( const Vector2f startPos,
const Vector2f endPos,
const Vector2f controlPos,
float  thick,
const RlColor color 
)
static

Draw a line using quadratic bezier curves with a control point.

Parameters
startPosto Draw from
endPosto Draw to
controlPosto use
thickto use
colorto use
Here is the call graph for this function:

◆ drawLineStrip()

void raylib::helper::draw::Draw2DHelper::drawLineStrip ( const std::vector< Vector2f > &  points,
const RlColor color 
)
static

Draw lines sequence.

Parameters
pointsthe points to draw
colorthe color to use
Here is the call graph for this function:

◆ drawPixel() [1/2]

void raylib::helper::draw::Draw2DHelper::drawPixel ( const Vector2f position,
const RlColor color 
)
static

Draw a pixel.

Parameters
positionto Draw at
colorto use
Here is the call graph for this function:

◆ drawPixel() [2/2]

void raylib::helper::draw::Draw2DHelper::drawPixel ( int  posX,
int  posY,
const RlColor color 
)
static

Draw a pixel.

Parameters
posXto Draw at
posYto Draw at
colorto use
Here is the call graph for this function:

◆ drawPoly()

void raylib::helper::draw::Draw2DHelper::drawPoly ( const Vector2f center,
int  sides,
float  radius,
float  rotation,
const RlColor color 
)
static

Draw a regular polygon (Vector version)

Parameters
centerto Draw at
sidesto use
radiusto use
rotationto use
colorto use
Here is the call graph for this function:

◆ drawPolyLines() [1/2]

void raylib::helper::draw::Draw2DHelper::drawPolyLines ( const Vector2f center,
int  sides,
float  radius,
float  rotation,
const RlColor color 
)
static

Draw a polygon outline of n sides.

Parameters
centerto Draw at
sidesto use
radiusto use
rotationto use
colorto use
Here is the call graph for this function:

◆ drawPolyLines() [2/2]

void raylib::helper::draw::Draw2DHelper::drawPolyLines ( const Vector2f center,
int  sides,
float  radius,
float  rotation,
float  lineThick,
const RlColor color 
)
static

Draw a polygon outline of n sides with extended parameters.

Parameters
centerto Draw at
sidesto use
radiusto use
rotationto use
lineThickto use
colorto use
Here is the call graph for this function:

◆ drawRectangle() [1/4]

void raylib::helper::draw::Draw2DHelper::drawRectangle ( const Rectangle &  rec,
const RlColor color 
)
static

Draw a filled rectangle.

Parameters
recto Draw
colorto use
Here is the call graph for this function:

◆ drawRectangle() [2/4]

void raylib::helper::draw::Draw2DHelper::drawRectangle ( const Rectangle &  rec,
const Vector2f origin,
float  rotation,
const RlColor color 
)
static

Draw a filled rectangle.

Parameters
recto Draw
originto use
rotationto use
colorto use
Here is the call graph for this function:

◆ drawRectangle() [3/4]

void raylib::helper::draw::Draw2DHelper::drawRectangle ( const Vector2f position,
const Vector2f size,
const RlColor color 
)
static

Draw a filled rectangle.

Parameters
positionto Draw at
sizeto use
colorto use
Here is the call graph for this function:

◆ drawRectangle() [4/4]

void raylib::helper::draw::Draw2DHelper::drawRectangle ( int  posX,
int  posY,
int  width,
int  height,
const RlColor color 
)
static

Draw a filled rectangle.

Parameters
posXto Draw at
posYto Draw at
widthto use
heightto use
colorto use
Here is the call graph for this function:

◆ drawRectangleGradient()

void raylib::helper::draw::Draw2DHelper::drawRectangleGradient ( const Rectangle &  rec,
const RlColor col1,
const RlColor col2,
const RlColor col3,
const RlColor col4 
)
static

Draw a gradient-filled rectangle with custom vertex colors.

Parameters
recto Draw
col1to use
col2to use
col3to use
col4to use
Here is the call graph for this function:

◆ drawRectangleGradientH()

void raylib::helper::draw::Draw2DHelper::drawRectangleGradientH ( int  posX,
int  posY,
int  width,
int  height,
const RlColor color1,
const RlColor color2 
)
static

Draw a horizontal-gradient-filled rectangle.

Parameters
posXto Draw at
posYto Draw at
widthto use
heightto use
color1to use
color2to use
Here is the call graph for this function:

◆ drawRectangleGradientV()

void raylib::helper::draw::Draw2DHelper::drawRectangleGradientV ( int  posX,
int  posY,
int  width,
int  height,
const RlColor color1,
const RlColor color2 
)
static

Draw a vertical-gradient-filled rectangle.

Parameters
posXto Draw at
posYto Draw at
widthto use
heightto use
color1to use
color2to use
Here is the call graph for this function:

◆ drawRectangleLines()

void raylib::helper::draw::Draw2DHelper::drawRectangleLines ( int  posX,
int  posY,
int  width,
int  height,
const RlColor color 
)
static

Draw rectangle outline.

Parameters
posXto Draw at
posYto Draw at
widthto use
heightto use
colorto use
Here is the call graph for this function:

◆ drawRectangleLinesEx()

void raylib::helper::draw::Draw2DHelper::drawRectangleLinesEx ( const Rectangle &  rec,
float  lineThick,
const RlColor color 
)
static

Draw rectangle outline with extended parameters.

Parameters
recto Draw
lineThickto use
colorto use
Here is the call graph for this function:

◆ drawRectangleRounded()

void raylib::helper::draw::Draw2DHelper::drawRectangleRounded ( const Rectangle &  rec,
float  roundness,
int  segments,
const RlColor color 
)
static

Draw rectangle with rounded edges.

Parameters
recto Draw
roundnessto use
segmentsto use
colorto use
Here is the call graph for this function:

◆ drawRectangleRoundedLines()

void raylib::helper::draw::Draw2DHelper::drawRectangleRoundedLines ( const Rectangle &  rec,
float  roundness,
int  segments,
float  lineThick,
const RlColor color 
)
static

Draw rectangle with rounded edges outline.

Parameters
recto Draw
roundnessto use
segmentsto use
lineThickto use
colorto use
Here is the call graph for this function:

◆ drawRing()

void raylib::helper::draw::Draw2DHelper::drawRing ( const Vector2f center,
float  innerRadius,
float  outerRadius,
float  startAngle,
float  endAngle,
int  segments,
const RlColor color 
)
static

Draw a ring.

Parameters
centerto Draw at
innerRadiusto use
outerRadiusto use
startAngleto use
endAngleto use
segmentsto use
colorto use
Here is the call graph for this function:

◆ drawRingLines()

void raylib::helper::draw::Draw2DHelper::drawRingLines ( const Vector2f center,
float  innerRadius,
float  outerRadius,
float  startAngle,
float  endAngle,
int  segments,
const RlColor color 
)
static

Draw a ring outline.

Parameters
centerto Draw at
innerRadiusto use
outerRadiusto use
startAngleto use
endAngleto use
segmentsto use
colorto use
Here is the call graph for this function:

◆ drawTriangle()

void raylib::helper::draw::Draw2DHelper::drawTriangle ( const Vector2f v1,
const Vector2f v2,
const Vector2f v3,
const RlColor color 
)
static

Draw a color-filled triangle (vertex in counter-clockwise order!)

Parameters
v1to Draw at
v2to Draw at
v3to Draw at
colorto use
Here is the call graph for this function:

◆ drawTriangleFan()

void raylib::helper::draw::Draw2DHelper::drawTriangleFan ( const std::vector< Vector2f > &  points,
const RlColor color 
)
static

Draw a triangle fan defined by points (first vertex is the center, shared by all triangles) By default, following vertex should be provided in counter-clockwise order.

Parameters
pointsto Draw
colorto use
Here is the call graph for this function:

◆ drawTriangleLines()

void raylib::helper::draw::Draw2DHelper::drawTriangleLines ( const Vector2f v1,
const Vector2f v2,
const Vector2f v3,
const RlColor color 
)
static

Draw a triangle outline (vertex in counter-clockwise order!)

Parameters
v1to Draw at
v2to Draw at
v3to Draw at
colorto use
Here is the call graph for this function:

◆ drawTriangleStrip()

void raylib::helper::draw::Draw2DHelper::drawTriangleStrip ( const std::vector< Vector2f > &  points,
const RlColor color 
)
static

Draw a triangle strip defined by points.

Parameters
pointsto Draw
colorto use
Here is the call graph for this function:

◆ setShapesTexture()

void raylib::helper::draw::Draw2DHelper::setShapesTexture ( const texture::RlTexture texture,
const Rectangle &  source 
)
static

Set texture and rectangle to be used on shapes drawing NOTE: It can be useful when using basic shapes and one single font, defining a font char white rectangle would allow drawing everything in a single Draw call.

Parameters
texturetexture to be used
sourcetexture rectangle to be used
Here is the call graph for this function:

The documentation for this class was generated from the following files: