Initial commit
This commit is contained in:
commit
0245a5cb43
22 changed files with 610 additions and 0 deletions
26
engine/render/rect.go
Normal file
26
engine/render/rect.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package render
|
||||
|
||||
import (
|
||||
"image/color"
|
||||
|
||||
rl "github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
||||
// DrawRectBorder draw a rectangle with a border around it.
|
||||
// Note that the rectangle passed as the 'rect' parameter to the function represents the actual
|
||||
// rectangle. The border will be drawn around it in all directions (outer border).
|
||||
func DrawRectBorder(rect rl.RectangleInt32, col color.RGBA, border_size int32, border_col color.RGBA) {
|
||||
rl.DrawRectangleRec(rl.Rectangle{
|
||||
X: float32(rect.X),
|
||||
Y: float32(rect.Y),
|
||||
Width: float32(rect.Width),
|
||||
Height: float32(rect.Height),
|
||||
}, col)
|
||||
|
||||
rl.DrawRectangleLinesEx(rl.Rectangle{
|
||||
X: float32(rect.X - border_size),
|
||||
Y: float32(rect.Y - border_size),
|
||||
Width: float32(rect.Width + (border_size * 2)),
|
||||
Height: float32(rect.Height + (border_size * 2)),
|
||||
}, float32(border_size), border_col)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue