gui: step
This commit is contained in:
parent
ce3c8e83dd
commit
806e6560f2
5 changed files with 4661 additions and 0 deletions
31
examples/gui/button/main.go
Normal file
31
examples/gui/button/main.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
rl "github.com/Konstantin8105/raylib"
|
||||
gui "github.com/Konstantin8105/raygui3.5"
|
||||
)
|
||||
|
||||
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 = gui.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