ColouringApp/scenes/title.go

54 lines
1.5 KiB
Go
Raw Normal View History

2024-01-08 13:29:40 +00:00
package scenes
import (
"ColouringApp/application"
gui "github.com/gen2brain/raylib-go/raygui"
raylib "github.com/gen2brain/raylib-go/raylib"
)
func Title() {
var (
2024-01-11 00:17:29 +00:00
titleText = application.WindowTitle
mapImage = raylib.LoadTexture(application.DirAssets + "Map.png")
2024-01-08 13:29:40 +00:00
2024-01-23 15:33:29 +00:00
//mapX = 0
//mapY = 0
2024-01-11 00:17:29 +00:00
)
2024-01-08 13:29:40 +00:00
for !application.ShouldQuit {
application.ShouldQuit = raylib.WindowShouldClose()
if application.CurrentScene != application.SceneTitle {
break
}
raylib.BeginDrawing()
raylib.ClearBackground(raylib.Black)
2024-01-15 12:19:49 +00:00
if gui.Button(raylib.NewRectangle(10, 10, 40, 40), gui.IconText(gui.ICON_CROSS, "")) {
application.ShouldQuit = true
2024-01-08 13:29:40 +00:00
}
2024-01-15 12:19:49 +00:00
raylib.DrawText(titleText, (application.WindowWidth-raylib.MeasureText(titleText, 20))/2, 20, 20, raylib.White)
if gui.Button(raylib.NewRectangle(application.WindowWidth-50, 10, 40, 40), gui.IconText(gui.ICON_GEAR, "")) {
2024-01-08 13:29:40 +00:00
application.CurrentScene = application.SceneOptions
}
2024-01-15 12:19:49 +00:00
//raylib.DrawLine(10, 60, 790, 60, raylib.White)
2024-01-08 13:29:40 +00:00
2024-01-23 15:33:29 +00:00
//// Map thing?
//raylib.DrawRectangleLines(120, 39, application.WindowWidth-130, application.WindowHeight-49, raylib.White)
//raylib.BeginScissorMode(121, 40, application.WindowWidth-132, application.WindowHeight-51)
//raylib.DrawTexture(mapImage, int32(-mapX), int32(-mapY), raylib.White)
2024-01-11 00:17:29 +00:00
raylib.EndScissorMode()
2024-01-15 12:19:49 +00:00
if gui.Button(raylib.NewRectangle((application.WindowWidth-100)/2, application.WindowHeight-70, 100, 40), "Start") {
2024-01-23 16:50:36 +00:00
application.CurrentScene = application.SceneDrawing
2024-01-11 00:17:29 +00:00
}
2024-01-08 13:29:40 +00:00
raylib.EndDrawing()
}
2024-01-11 00:17:29 +00:00
raylib.UnloadTexture(mapImage)
2024-01-08 13:29:40 +00:00
}