From b87c8653e5d22bdad764bb9f39aa3440e971a46e Mon Sep 17 00:00:00 2001 From: Konstantin8105 Date: Tue, 22 Nov 2022 18:41:59 +0300 Subject: [PATCH] step --- examples/go.mod | 2 ++ examples/main.go | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 examples/main.go diff --git a/examples/go.mod b/examples/go.mod index 927c03d..2fc250b 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -1,3 +1,5 @@ module example go 1.19 + +require github.com/Konstantin8105/raylib-go/raylib v0.0.0-20221122153952-2f5d9114177b // indirect diff --git a/examples/main.go b/examples/main.go new file mode 100644 index 0000000..c461680 --- /dev/null +++ b/examples/main.go @@ -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() +}