step
This commit is contained in:
parent
2f5d911417
commit
b87c8653e5
2 changed files with 32 additions and 0 deletions
|
@ -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
30
examples/main.go
Normal 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()
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue