raylib/shapes
src/raylib/shapes.tur
defn
draw-circle
(draw-circle [cx :int cy :int radius :float col :int] :void)
draw a filled circle using integer center coordinates.
Parameters
| cx | center x (pixels) | |
| cy | center y (pixels) | |
| radius | circle radius (pixels) | |
| col | Color handle |
Example
(draw-circle 400 300 50.0 (red))
Since: P3
defn
draw-circle-v
(draw-circle-v [center :int radius :float col :int] :void)
draw a filled circle using a Vector2 center handle.
Parameters
| center | Vector2 handle for center position | |
| radius | circle radius (pixels) | |
| col | Color handle |
Example
(draw-circle-v pos 40.0 (red))
Since: P3
defn
draw-rectangle
(draw-rectangle [x :int y :int w :int h :int col :int] :void)
draw a filled axis-aligned rectangle.
Parameters
| x | left edge (pixels) | |
| y | top edge (pixels) | |
| w | width (pixels) | |
| h | height (pixels) | |
| col | Color handle |
Example
(draw-rectangle 100 100 200 150 (blue))
Since: P3
defn
draw-rectangle-rec
(draw-rectangle-rec [rec :int col :int] :void)
draw a filled rectangle from a Rectangle handle.
Parameters
| rec | Rectangle handle (x y width height; construct with make-rect below) | |
| col | Color handle |
Example
(draw-rectangle-rec my-rect (green))
Since: P3
defn
draw-line
(draw-line [x1 :int y1 :int x2 :int y2 :int col :int] :void)
draw a line between two points given as integer coordinates.
Parameters
| x1 y1 -- start point (pixels) | ||
| x2 y2 -- end point (pixels) | ||
| col | Color handle |
Example
(draw-line 0 0 800 600 (white))
Since: P3
defn
draw-line-v
(draw-line-v [start :int end :int col :int] :void)
draw a line between two Vector2 handle endpoints.
Parameters
| start | start Vector2 handle | |
| end | end Vector2 handle | |
| col | Color handle |
Example
(draw-line-v p1 p2 (white))
Since: P3
defn
draw-triangle
(draw-triangle [v1 :int v2 :int v3 :int col :int] :void)
draw a filled triangle given three Vector2 handle vertices.
Parameters
| v1 v2 v3 -- Vector2 handle vertices (counter-clockwise winding) | ||
| col | Color handle |
Example
(draw-triangle a b c (yellow))
Since: P3
Internal definitions
__make-vec2-- allocate a Raylib Vector2 from separate x y floats.