mirror of
https://github.com/Fluffy-Bean/ColouringApp.git
synced 2025-01-29 15:48:27 +00:00
Merge changes from PC
This commit is contained in:
parent
9225fd428a
commit
2e2ae6b9a0
|
@ -10,17 +10,23 @@ import (
|
|||
|
||||
func Options() {
|
||||
var (
|
||||
titlePos float32 = 10
|
||||
titleForwardPos float32 = 45
|
||||
|
||||
centerPos float32 = 10
|
||||
backPos float32 = -application.WindowWidth + 10
|
||||
forwardPos float32 = application.WindowWidth + 10
|
||||
|
||||
rootPanelPos = true
|
||||
controlsPanelPos = false
|
||||
graphicPanelPos = false
|
||||
rootPanel = true
|
||||
controlsPanel = false
|
||||
graphicPanel = false
|
||||
|
||||
rootPos = centerPos
|
||||
controlsPos = forwardPos
|
||||
graphicPos = forwardPos
|
||||
|
||||
titleControls = titleForwardPos
|
||||
titleGraphics = titleForwardPos
|
||||
)
|
||||
// load resources here
|
||||
|
||||
|
@ -32,60 +38,62 @@ func Options() {
|
|||
break
|
||||
}
|
||||
|
||||
if rootPanel {
|
||||
rootPos = raylib.Lerp(rootPos, centerPos, 0.1)
|
||||
} else {
|
||||
rootPos = raylib.Lerp(rootPos, backPos, 0.1)
|
||||
}
|
||||
if controlsPanel {
|
||||
controlsPos = raylib.Lerp(controlsPos, centerPos, 0.1)
|
||||
titleControls = raylib.Lerp(titleControls, titlePos, 0.1)
|
||||
} else {
|
||||
controlsPos = raylib.Lerp(controlsPos, forwardPos, 0.1)
|
||||
titleControls = raylib.Lerp(titleControls, titleForwardPos, 0.1)
|
||||
}
|
||||
if graphicPanel {
|
||||
graphicPos = raylib.Lerp(graphicPos, centerPos, 0.1)
|
||||
titleGraphics = raylib.Lerp(titleGraphics, titlePos, 0.1)
|
||||
} else {
|
||||
graphicPos = raylib.Lerp(graphicPos, forwardPos, 0.1)
|
||||
titleGraphics = raylib.Lerp(titleGraphics, titleForwardPos, 0.1)
|
||||
}
|
||||
|
||||
raylib.BeginDrawing()
|
||||
raylib.ClearBackground(raylib.Black)
|
||||
|
||||
raylib.DrawText("Options", 10, 10, 20, raylib.White)
|
||||
raylib.BeginScissorMode(0, 0, application.WindowWidth, 40)
|
||||
raylib.DrawText("| Controls", 95, int32(titleControls), 20, raylib.White)
|
||||
raylib.DrawText("| Graphics", 95, int32(titleGraphics), 20, raylib.White)
|
||||
raylib.EndScissorMode()
|
||||
|
||||
raylib.DrawLine(10, 40, 790, 40, raylib.White)
|
||||
if gui.Button(raylib.NewRectangle(application.WindowWidth-110, 10, 100, 20), "Main Menu") {
|
||||
application.CurrentScene = application.SceneTitle
|
||||
}
|
||||
|
||||
// ROOT PANEL FOR SETTINGS
|
||||
{
|
||||
if rootPanelPos {
|
||||
rootPos = raylib.Lerp(rootPos, centerPos, 0.1)
|
||||
} else {
|
||||
rootPos = raylib.Lerp(rootPos, backPos, 0.1)
|
||||
}
|
||||
if gui.Button(raylib.NewRectangle(rootPos, 50, 100, 20), "Controls") {
|
||||
rootPanelPos = false
|
||||
controlsPanelPos = true
|
||||
}
|
||||
if gui.Button(raylib.NewRectangle(rootPos, 80, 100, 20), "Graphics") {
|
||||
rootPanelPos = false
|
||||
graphicPanelPos = true
|
||||
}
|
||||
if gui.Button(raylib.NewRectangle(rootPos, 50, 100, 20), "Controls") {
|
||||
rootPanel = false
|
||||
controlsPanel = true
|
||||
}
|
||||
if gui.Button(raylib.NewRectangle(rootPos, 80, 100, 20), "Graphics") {
|
||||
rootPanel = false
|
||||
graphicPanel = true
|
||||
}
|
||||
|
||||
// CONTROLS PANEL
|
||||
{
|
||||
if controlsPanelPos {
|
||||
controlsPos = raylib.Lerp(controlsPos, centerPos, 0.1)
|
||||
} else {
|
||||
controlsPos = raylib.Lerp(controlsPos, forwardPos, 0.1)
|
||||
}
|
||||
|
||||
raylib.DrawText("Controls", int32(controlsPos), 50, 20, raylib.White)
|
||||
if gui.Button(raylib.NewRectangle(controlsPos, 80, 100, 20), "Back") {
|
||||
rootPanelPos = true
|
||||
controlsPanelPos = false
|
||||
}
|
||||
raylib.DrawText("Controls", int32(controlsPos), 50, 20, raylib.White)
|
||||
if gui.Button(raylib.NewRectangle(controlsPos, 80, 100, 20), "Back") {
|
||||
rootPanel = true
|
||||
controlsPanel = false
|
||||
}
|
||||
|
||||
// GRAPHICS PANEL
|
||||
{
|
||||
if graphicPanelPos {
|
||||
graphicPos = raylib.Lerp(graphicPos, centerPos, 0.1)
|
||||
} else {
|
||||
graphicPos = raylib.Lerp(graphicPos, forwardPos, 0.1)
|
||||
}
|
||||
|
||||
raylib.DrawText("Graphics", int32(graphicPos), 50, 20, raylib.White)
|
||||
if gui.Button(raylib.NewRectangle(graphicPos, 80, 100, 20), "Back") {
|
||||
rootPanelPos = true
|
||||
graphicPanelPos = false
|
||||
}
|
||||
raylib.DrawText("Graphics", int32(graphicPos), 50, 20, raylib.White)
|
||||
if gui.Button(raylib.NewRectangle(graphicPos, 80, 100, 20), "Back") {
|
||||
rootPanel = true
|
||||
graphicPanel = false
|
||||
}
|
||||
|
||||
raylib.EndDrawing()
|
||||
|
|
Loading…
Reference in a new issue