From 7d41c2d3df5d05b6ce7a5e56a682324e9e724b1e Mon Sep 17 00:00:00 2001 From: xzebra Date: Sat, 6 Feb 2021 01:12:27 +0100 Subject: [PATCH] rounded rectangle functions --- raylib/shapes.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/raylib/shapes.go b/raylib/shapes.go index e5926b0..2bdf435 100644 --- a/raylib/shapes.go +++ b/raylib/shapes.go @@ -244,6 +244,25 @@ func DrawRectangleLinesEx(rec Rectangle, lineThick int32, color Color) { C.DrawRectangleLinesEx(*crec, clineThick, *ccolor) } +// DrawRectangleRounded - Draw rectangle with rounded edges +func DrawRectangleRounded(rec Rectangle, roundness float32, segments int32, color Color) { + crec := rec.cptr() + croundness := (C.float)(roundness) + csegments := (C.int)(segments) + ccolor := color.cptr() + C.DrawRectangleRounded(*crec, croundness, csegments, *ccolor) +} + +// DrawRectangleRoundedLines - Draw rectangle with rounded edges outline +func DrawRectangleRoundedLines(rec Rectangle, roundness float32, segments, lineThick int32, color Color) { + crec := rec.cptr() + croundness := (C.float)(roundness) + csegments := (C.int)(segments) + clineThick := (C.int)(lineThick) + ccolor := color.cptr() + C.DrawRectangleRoundedLines(*crec, croundness, csegments, clineThick, *ccolor) +} + // DrawTriangle - Draw a color-filled triangle func DrawTriangle(v1, v2, v3 Vector2, color Color) { cv1 := v1.cptr()