rl.setShapesTexture
Set texture and rectangle to be used on shapes drawing
Zigfn setShapesTexture(texture: Texture2D, rec: Rectangle) voidCvoid SetShapesTexture(Texture2D texture, Rectangle rec);2D shapes, splines and collision checks. 75 functions, from raylib's rshapes.
Set texture and rectangle to be used on shapes drawing
Zigfn setShapesTexture(texture: Texture2D, rec: Rectangle) voidCvoid SetShapesTexture(Texture2D texture, Rectangle rec);Get texture that is used for shapes drawing
Zigfn getShapesTexture() Texture2DCTexture2D GetShapesTexture(void);Get texture source rectangle that is used for shapes drawing
Zigfn getShapesTextureRectangle() RectangleCRectangle GetShapesTextureRectangle(void);Draw a pixel using geometry [Can be slow, use with care]
Zigfn drawPixel(posX: i32, posY: i32, color: Color) voidCvoid DrawPixel(int posX, int posY, Color color);Draw a pixel using geometry (Vector version) [Can be slow, use with care]
Zigfn drawPixelV(position: Vector2, color: Color) voidCvoid DrawPixelV(Vector2 position, Color color);Draw a line
Zigfn drawLine(startPosX: i32, startPosY: i32, endPosX: i32, endPosY: i32, color: Color) voidCvoid DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);Used in core_2d_camera, core_highdpi_demo, core_undo_redo, core_highdpi_testbed, shapes_basic_shapes, shapes_recursive_tree and 13 more.
Draw a line (using gl lines)
Zigfn drawLineV(startPos: Vector2, endPos: Vector2, color: Color) voidCvoid DrawLineV(Vector2 startPos, Vector2 endPos, Color color);Used in core_2d_camera_split_screen, core_screen_recording, shapes_splines_drawing, shapes_starfield_effect, textures_textured_curve, audio_raw_stream and 2 more.
Draw a line (using triangles/quads)
Zigfn drawLineEx(startPos: Vector2, endPos: Vector2, thick: f32, color: Color) voidCvoid DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color);Used in core_input_gestures_testbed, shapes_recursive_tree, shapes_splines_drawing, shapes_digital_clock, shapes_double_pendulum, shapes_vector_angle and 7 more.
Draw lines sequence (using gl lines)
Zigfn drawLineStrip(points: []const Vector2, color: Color) voidCvoid DrawLineStrip(const Vector2 *points, int pointCount, Color color);Draw line segment cubic-bezier in-out interpolation
Zigfn drawLineBezier(startPos: Vector2, endPos: Vector2, thick: f32, color: Color) voidCvoid DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color);Used in shapes_lines_bezier, shapes_recursive_tree.
Draw a dashed line
Zigfn drawLineDashed(startPos: Vector2, endPos: Vector2, dashSize: i32, spaceSize: i32, color: Color) voidCvoid DrawLineDashed(Vector2 startPos, Vector2 endPos, int dashSize, int spaceSize, Color color);Used in shapes_dashed_line, shapes_math_sine_cosine.
Draw a color-filled triangle, counter-clockwise vertex order
Zigfn drawTriangle(v1: Vector2, v2: Vector2, v3: Vector2, color: Color) voidCvoid DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color);Used in core_input_gamepad, core_input_gestures_testbed, core_input_virtual_controls, core_automation_events, shapes_basic_shapes, shapes_rectangle_scaling and 5 more.
Draw triangle with interpolated colors, counter-clockwise vertex/color order
Zigfn drawTriangleGradient(v1: Vector2, v2: Vector2, v3: Vector2, c1: Color, c2: Color, c3: Color) voidCvoid DrawTriangleGradient(Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3);Draw triangle outline, counter-clockwise vertex order
Zigfn drawTriangleLines(v1: Vector2, v2: Vector2, v3: Vector2, color: Color) voidCvoid DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color);Used in shapes_basic_shapes, shapes_triangle_strip, shapes_outlines_testbed, shaders_shapes_textures.
Draw triangle outline with line thickness, counter-clockwise vertex order
Zigfn drawTriangleLinesEx(v1: Vector2, v2: Vector2, v3: Vector2, thick: f32, color: Color) voidCvoid DrawTriangleLinesEx(Vector2 v1, Vector2 v2, Vector2 v3, float thick, Color color);Used in shapes_drag_puzzle, shapes_outlines_testbed.
Draw a triangle fan defined by points (first vertex is the center)
Zigfn drawTriangleFan(points: []const Vector2, color: Color) voidCvoid DrawTriangleFan(const Vector2 *points, int pointCount, Color color);Used in shapes_top_down_lights.
Draw a triangle strip defined by points
Zigfn drawTriangleStrip(points: []const Vector2, color: Color) voidCvoid DrawTriangleStrip(const Vector2 *points, int pointCount, Color color);Used in shapes_digital_clock.
Draw a color-filled rectangle
Zigfn drawRectangle(posX: i32, posY: i32, width: i32, height: i32, color: Color) voidCvoid DrawRectangle(int posX, int posY, int width, int height, Color color);Used in core_input_mouse_wheel, core_input_gamepad, core_input_gestures, core_input_gestures_testbed, core_2d_camera, core_2d_camera_split_screen and 77 more.
Draw a color-filled rectangle (Vector version)
Zigfn drawRectangleV(position: Vector2, size: Vector2, color: Color) voidCvoid DrawRectangleV(Vector2 position, Vector2 size, Color color);Used in core_monitor_detector, core_input_actions, shapes_rlgl_color_wheel, textures_fog_of_war.
Draw a color-filled rectangle
Zigfn drawRectangleRec(rec: Rectangle, color: Color) voidCvoid DrawRectangleRec(Rectangle rec, Color color);Used in core_input_gamepad, core_input_gestures, core_input_gestures_testbed, core_2d_camera, core_2d_camera_platformer, core_2d_camera_split_screen and 29 more.
Draw a color-filled rectangle with pro parameters
Zigfn drawRectanglePro(rec: Rectangle, origin: Vector2, rotation: f32, color: Color) voidCvoid DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color);Used in core_smooth_pixelperfect, shapes_bullet_hell, shapes_easings_box, shapes_easings_rectangles, shapes_digital_clock, shapes_double_pendulum and 1 more.
Draw a vertical-gradient-filled rectangle
Zigfn drawRectangleGradientV(posX: i32, posY: i32, width: i32, height: i32, top: Color, bottom: Color) voidCvoid DrawRectangleGradientV(int posX, int posY, int width, int height, Color top, Color bottom);Draw a horizontal-gradient-filled rectangle
Zigfn drawRectangleGradientH(posX: i32, posY: i32, width: i32, height: i32, left: Color, right: Color) voidCvoid DrawRectangleGradientH(int posX, int posY, int width, int height, Color left, Color right);Used in shapes_basic_shapes, shaders_shapes_textures.
Draw a gradient-filled rectangle with custom vertex colors, counter-clockwise color order
Zigfn drawRectangleGradientEx(rec: Rectangle, col1: Color, col2: Color, col3: Color, col4: Color) voidCvoid DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4);Used in shapes_rectangle_advanced.
Draw rectangle outline
Zigfn drawRectangleLines(posX: i32, posY: i32, width: i32, height: i32, color: Color) voidCvoid DrawRectangleLines(int posX, int posY, int width, int height, Color color);Used in core_input_gestures, core_2d_camera, core_3d_camera_free, core_3d_camera_first_person, core_3d_camera_fps, core_monitor_detector and 38 more.
Draw rectangle outline with line thickness
Zigfn drawRectangleLinesEx(rec: Rectangle, thick: f32, color: Color) voidCvoid DrawRectangleLinesEx(Rectangle rec, float thick, Color color);Used in core_window_flags, core_monitor_detector, core_scissor_test, core_viewport_scaling, core_keyboard_testbed, shapes_colors_palette and 15 more.
Draw rectangle with rounded edges
Zigfn drawRectangleRounded(rec: Rectangle, roundness: f32, segments: i32, color: Color) voidCvoid DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color);Used in core_input_gamepad, shapes_rounded_rectangle_drawing, shapes_outlines_testbed, shapes_outlines_thickness.
Draw rectangle lines with rounded edges
Zigfn drawRectangleRoundedLines(rec: Rectangle, roundness: f32, segments: i32, color: Color) voidCvoid DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, Color color);Used in shapes_outlines_testbed.
Draw rectangle lines with rounded edges outline and line thickness
Zigfn drawRectangleRoundedLinesEx(rec: Rectangle, roundness: f32, segments: i32, thick: f32, color: Color) voidCvoid DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, float thick, Color color);Used in shapes_rounded_rectangle_drawing, shapes_outlines_testbed, shapes_outlines_thickness.
Draw a polygon of n sides
Zigfn drawPoly(center: Vector2, sides: i32, radius: f32, rotation: f32, color: Color) voidCvoid DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color);Used in shapes_basic_shapes, shapes_outlines_testbed, shapes_polygon_lines, shaders_shapes_textures, gl_scissor_shapes.
Draw a polygon outline of n sides
Zigfn drawPolyLines(center: Vector2, sides: i32, radius: f32, rotation: f32, color: Color) voidCvoid DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color);Used in shapes_basic_shapes, shapes_outlines_testbed.
Draw a polygon outline of n sides with line thickness
Zigfn drawPolyLinesEx(center: Vector2, sides: i32, radius: f32, rotation: f32, thick: f32, color: Color) voidCvoid DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float thick, Color color);Used in shapes_basic_shapes, shapes_outlines_testbed, shapes_polygon_lines.
Draw a color-filled circle
Zigfn drawCircle(centerX: i32, centerY: i32, radius: f32, color: Color) voidCvoid DrawCircle(int centerX, int centerY, float radius, Color color);Used in core_input_gamepad, core_input_gestures_testbed, core_2d_camera_mouse_zoom, core_custom_frame_control, core_automation_events, shapes_basic_shapes and 10 more.
Draw a color-filled circle (Vector version)
Zigfn drawCircleV(center: Vector2, radius: f32, color: Color) voidCvoid DrawCircleV(Vector2 center, float radius, Color color);Used in core_delta_time, core_input_keys, core_input_mouse, core_input_multitouch, core_input_gestures, core_input_gestures_testbed and 31 more.
Draw a gradient-filled circle
Zigfn drawCircleGradient(center: Vector2, radius: f32, inner: Color, outer: Color) voidCvoid DrawCircleGradient(Vector2 center, float radius, Color inner, Color outer);Used in shapes_basic_shapes, shapes_top_down_lights, shaders_shapes_textures.
Draw a piece of a circle
Zigfn drawCircleSector(center: Vector2, radius: f32, startAngle: f32, endAngle: f32, segments: i32, color: Color) voidCvoid DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color);Used in shapes_circle_sector_drawing, shapes_vector_angle, shapes_pie_chart, shapes_outlines_testbed.
Draw circle sector outline
Zigfn drawCircleSectorLines(center: Vector2, radius: f32, startAngle: f32, endAngle: f32, segments: i32, color: Color) voidCvoid DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color);Used in shapes_ring_drawing, shapes_circle_sector_drawing, shapes_math_sine_cosine, shapes_outlines_testbed.
Draw circle sector outline with thickness
Zigfn drawCircleSectorLinesEx(center: Vector2, radius: f32, startAngle: f32, endAngle: f32, segments: i32, thick: f32, color: Color) voidCvoid DrawCircleSectorLinesEx(Vector2 center, float radius, float startAngle, float endAngle, int segments, float thick, Color color);Used in shapes_outlines_testbed.
Draw circle outline
Zigfn drawCircleLines(centerX: i32, centerY: i32, radius: f32, color: Color) voidCvoid DrawCircleLines(int centerX, int centerY, float radius, Color color);Used in shapes_basic_shapes, shapes_bullet_hell, textures_mouse_painting, shaders_shapes_textures.
Draw circle outline (Vector version)
Zigfn drawCircleLinesV(center: Vector2, radius: f32, color: Color) voidCvoid DrawCircleLinesV(Vector2 center, float radius, Color color);Used in shapes_bullet_hell, shapes_splines_drawing, shapes_math_sine_cosine, shapes_lines_drawing, shapes_rlgl_color_wheel, shapes_rlgl_triangle and 2 more.
Draw circle outline with line thickness
Zigfn drawCircleLinesEx(center: Vector2, radius: f32, thick: f32, color: Color) voidCvoid DrawCircleLinesEx(Vector2 center, float radius, float thick, Color color);Used in shapes_drag_puzzle, shapes_outlines_testbed, shapes_outlines_thickness, shapes_polygon_lines.
Draw ellipse
Zigfn drawEllipse(centerX: i32, centerY: i32, radiusH: f32, radiusV: f32, color: Color) voidCvoid DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color);Used in shapes_basic_shapes, shapes_ellipse_collision.
Draw ellipse (Vector version)
Zigfn drawEllipseV(center: Vector2, radiusH: f32, radiusV: f32, color: Color) voidCvoid DrawEllipseV(Vector2 center, float radiusH, float radiusV, Color color);Used in shapes_outlines_testbed.
Draw ellipse outline
Zigfn drawEllipseLines(centerX: i32, centerY: i32, radiusH: f32, radiusV: f32, color: Color) voidCvoid DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color);Used in shapes_basic_shapes, shapes_ellipse_collision.
Draw ellipse outline (Vector version)
Zigfn drawEllipseLinesV(center: Vector2, radiusH: f32, radiusV: f32, color: Color) voidCvoid DrawEllipseLinesV(Vector2 center, float radiusH, float radiusV, Color color);Used in shapes_outlines_testbed.
Draw ellipse outline with line thickness
Zigfn drawEllipseLinesEx(center: Vector2, radiusH: f32, radiusV: f32, thick: f32, color: Color) voidCvoid DrawEllipseLinesEx(Vector2 center, float radiusH, float radiusV, float thick, Color color);Used in shapes_outlines_testbed.
Draw ring
Zigfn drawRing(center: Vector2, innerRadius: f32, outerRadius: f32, startAngle: f32, endAngle: f32, segments: i32, color: Color) voidCvoid DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color);Used in core_input_gestures_testbed, shapes_ring_drawing, shapes_clock_of_clocks, shapes_outlines_testbed, textures_magnifying_glass.
Draw ring outline
Zigfn drawRingLines(center: Vector2, innerRadius: f32, outerRadius: f32, startAngle: f32, endAngle: f32, segments: i32, color: Color) voidCvoid DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color);Used in shapes_ring_drawing, shapes_outlines_testbed.
Draw ring outline with line thickness
Zigfn drawRingLinesEx(center: Vector2, innerRadius: f32, outerRadius: f32, startAngle: f32, endAngle: f32, segments: i32, thick: f32, color: Color) voidCvoid DrawRingLinesEx(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, float thick, Color color);Used in shapes_outlines_testbed.
Draw spline: Linear, minimum 2 points
Zigfn drawSplineLinear(points: []const Vector2, thick: f32, color: Color) voidCvoid DrawSplineLinear(const Vector2 *points, int pointCount, float thick, Color color);Draw spline: B-Spline, minimum 4 points
Zigfn drawSplineBasis(points: []const Vector2, thick: f32, color: Color) voidCvoid DrawSplineBasis(const Vector2 *points, int pointCount, float thick, Color color);Used in shapes_splines_drawing.
Draw spline: Catmull-Rom, minimum 4 points
Zigfn drawSplineCatmullRom(points: []const Vector2, thick: f32, color: Color) voidCvoid DrawSplineCatmullRom(const Vector2 *points, int pointCount, float thick, Color color);Used in shapes_splines_drawing.
Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]
Zigfn drawSplineBezierQuadratic(points: []const Vector2, thick: f32, color: Color) voidCvoid DrawSplineBezierQuadratic(const Vector2 *points, int pointCount, float thick, Color color);Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]
Zigfn drawSplineBezierCubic(points: []const Vector2, thick: f32, color: Color) voidCvoid DrawSplineBezierCubic(const Vector2 *points, int pointCount, float thick, Color color);Used in shapes_splines_drawing.
Draw spline segment: Linear, 2 points
Zigfn drawSplineSegmentLinear(p1: Vector2, p2: Vector2, thick: f32, color: Color) voidCvoid DrawSplineSegmentLinear(Vector2 p1, Vector2 p2, float thick, Color color);Draw spline segment: B-Spline, 4 points
Zigfn drawSplineSegmentBasis(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: f32, color: Color) voidCvoid DrawSplineSegmentBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color);Draw spline segment: Catmull-Rom, 4 points
Zigfn drawSplineSegmentCatmullRom(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, thick: f32, color: Color) voidCvoid DrawSplineSegmentCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color);Draw spline segment: Quadratic Bezier, 2 points, 1 control point
Zigfn drawSplineSegmentBezierQuadratic(p1: Vector2, c2: Vector2, p3: Vector2, thick: f32, color: Color) voidCvoid DrawSplineSegmentBezierQuadratic(Vector2 p1, Vector2 c2, Vector2 p3, float thick, Color color);Draw spline segment: Cubic Bezier, 2 points, 2 control points
Zigfn drawSplineSegmentBezierCubic(p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, thick: f32, color: Color) voidCvoid DrawSplineSegmentBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float thick, Color color);Used in textures_textured_curve.
Get (evaluate) spline point: Linear
Zigfn getSplinePointLinear(startPos: Vector2, endPos: Vector2, t: f32) Vector2CVector2 GetSplinePointLinear(Vector2 startPos, Vector2 endPos, float t);Get (evaluate) spline point: B-Spline
Zigfn getSplinePointBasis(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: f32) Vector2CVector2 GetSplinePointBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t);Get (evaluate) spline point: Catmull-Rom
Zigfn getSplinePointCatmullRom(p1: Vector2, p2: Vector2, p3: Vector2, p4: Vector2, t: f32) Vector2CVector2 GetSplinePointCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t);Get (evaluate) spline point: Quadratic Bezier
Zigfn getSplinePointBezierQuadratic(p1: Vector2, c2: Vector2, p3: Vector2, t: f32) Vector2CVector2 GetSplinePointBezierQuadratic(Vector2 p1, Vector2 c2, Vector2 p3, float t);Get (evaluate) spline point: Cubic Bezier
Zigfn getSplinePointBezierCubic(p1: Vector2, c2: Vector2, c3: Vector2, p4: Vector2, t: f32) Vector2CVector2 GetSplinePointBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float t);Check collision between two rectangles
Zigfn checkCollisionRecs(rec1: Rectangle, rec2: Rectangle) boolCbool CheckCollisionRecs(Rectangle rec1, Rectangle rec2);Used in shapes_collision_area, shapes_top_down_lights, text_strings_management.
Check collision between two circles
Zigfn checkCollisionCircles(center1: Vector2, radius1: f32, center2: Vector2, radius2: f32) boolCbool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2);Check collision between circle and rectangle
Zigfn checkCollisionCircleRec(center: Vector2, radius: f32, rec: Rectangle) boolCbool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec);Used in models_first_person_maze.
Check if circle collides with a line created between two points [p1] and [p2]
Zigfn checkCollisionCircleLine(center: Vector2, radius: f32, p1: Vector2, p2: Vector2) boolCbool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2);Check if point is inside rectangle
Zigfn checkCollisionPointRec(point: Vector2, rec: Rectangle) boolCbool CheckCollisionPointRec(Vector2 point, Rectangle rec);Used in core_input_gamepad, core_input_gestures, core_input_gestures_testbed, core_viewport_scaling, core_keyboard_testbed, shapes_colors_palette and 16 more.
Check if point is inside circle
Zigfn checkCollisionPointCircle(point: Vector2, center: Vector2, radius: f32) boolCbool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius);Used in shapes_lines_bezier, shapes_following_eyes, shapes_splines_drawing, shapes_rlgl_triangle, shapes_drag_puzzle, textures_textured_curve.
Check if point is inside a triangle
Zigfn checkCollisionPointTriangle(point: Vector2, p1: Vector2, p2: Vector2, p3: Vector2) boolCbool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3);Used in shapes_drag_puzzle.
Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]
Zigfn checkCollisionPointLine(point: Vector2, p1: Vector2, p2: Vector2, threshold: i32) boolCbool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold);Check if point is within a polygon described by array of vertices
Zigfn checkCollisionPointPoly(point: Vector2, points: []const Vector2) boolCbool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCount);Check the collision between two lines defined by two points each, returns collision point by reference
Zigfn checkCollisionLines(startPos1: Vector2, endPos1: Vector2, startPos2: Vector2, endPos2: Vector2, collisionPoint: *Vector2) boolCbool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint);Get collision rectangle for two rectangles collision
Zigfn getCollisionRec(rec1: Rectangle, rec2: Rectangle) RectangleCRectangle GetCollisionRec(Rectangle rec1, Rectangle rec2);Used in shapes_collision_area, shapes_drag_puzzle.