Overview
Shapes functions provide 2D primitive drawing capabilities including rectangles, circles, lines, triangles, and polygons.Pixel and Line Drawing
drawPixel
Draws a pixel.X position
Y position
Pixel color
drawPixelV
Draws a pixel using a Vector2.Pixel position
Pixel color
drawLine
Draws a line.Start X position
Start Y position
End X position
End Y position
Line color
drawLineV
Draws a line using Vector2 points.Start position
End position
Line color
drawLineEx
Draws a line with thickness.Start position
End position
Line thickness
Line color
drawLineBezier
Draws a cubic Bezier line.Start position
End position
Line thickness
Line color
Circle Drawing
drawCircle
Draws a filled circle.Center X position
Center Y position
Circle radius
Circle color
drawCircleV
Draws a circle using Vector2 for center.Circle center
Circle radius
Circle color
drawCircleLines
Draws circle outline.Center X
Center Y
Circle radius
Outline color
drawCircleGradient
Draws a gradient-filled circle.Center X
Center Y
Circle radius
Center color
Edge color
Rectangle Drawing
drawRectangle
Draws a filled rectangle.X position
Y position
Rectangle width
Rectangle height
Rectangle color
drawRectangleV
Draws rectangle using Vector2 for position and size.Position
Size
Rectangle color
drawRectangleRec
Draws rectangle using Rectangle struct.Rectangle to draw
Rectangle color
drawRectanglePro
Draws rectangle with origin and rotation.Rectangle
Rotation origin
Rotation in degrees
Rectangle color
drawRectangleGradientV
Draws vertical gradient-filled rectangle.X position
Y position
Width
Height
Top color
Bottom color
drawRectangleGradientH
Draws horizontal gradient-filled rectangle.X position
Y position
Width
Height
Left color
Right color
drawRectangleLines
Draws rectangle outline.X position
Y position
Width
Height
Outline color
drawRectangleRounded
Draws rectangle with rounded corners.Rectangle
Corner roundness (0.0 to 1.0)
Number of segments per corner
Rectangle color
Triangle Drawing
drawTriangle
Draws a filled triangle.First vertex
Second vertex
Third vertex
Triangle color
drawTriangleLines
Draws triangle outline.First vertex
Second vertex
Third vertex
Outline color
Polygon Drawing
drawPoly
Draws a regular polygon.Polygon center
Number of sides
Polygon radius
Rotation in degrees
Polygon color
drawPolyLines
Draws polygon outline.Polygon center
Number of sides
Polygon radius
Rotation in degrees
Outline color
Collision Detection
checkCollisionRecs
Checks collision between two rectangles.First rectangle
Second rectangle
Boolean - True if collision detected
checkCollisionCircles
Checks collision between two circles.First circle center
First circle radius
Second circle center
Second circle radius
Boolean - True if collision detected
checkCollisionCircleRec
Checks collision between circle and rectangle.Circle center
Circle radius
Rectangle
Boolean - True if collision detected
checkCollisionPointRec
Checks if point is inside rectangle.Point to check
Rectangle
Boolean - True if point is inside
checkCollisionPointCircle
Checks if point is inside circle.Point to check
Circle center
Circle radius
Boolean - True if point is inside
Best Practices
Collision detection functions are very efficient for basic 2D games. Use them for simple AABB collision before implementing more complex systems.