This commit is contained in:
Konstantin8105 2022-11-22 18:41:59 +03:00
parent 2f5d911417
commit b87c8653e5
2 changed files with 32 additions and 0 deletions

View file

@ -1,3 +1,5 @@
module example module example
go 1.19 go 1.19
require github.com/Konstantin8105/raylib-go/raylib v0.0.0-20221122153952-2f5d9114177b // indirect

30
examples/main.go Normal file
View file

@ -0,0 +1,30 @@
package main
import (
"fmt"
rl "github.com/Konstantin8105/raylib-go/raylib"
)
func main() {
rl.InitWindow(800, 450, "raylib [physics] example - box2d")
rl.SetTargetFPS(60)
var button bool
for !rl.WindowShouldClose() {
rl.BeginDrawing()
rl.ClearBackground(rl.Black)
button = rl.Button(rl.NewRectangle(50, 150, 100, 40), "Click")
if button {
fmt.Println("Clicked on button")
}
rl.EndDrawing()
}
rl.CloseWindow()
}