mirror of
https://github.com/Fluffy-Bean/ColouringApp.git
synced 2025-05-14 07:32:16 +00:00
Merge changes from PC
This commit is contained in:
parent
9225fd428a
commit
2e2ae6b9a0
1 changed files with 49 additions and 41 deletions
|
@ -10,17 +10,23 @@ import (
|
||||||
|
|
||||||
func Options() {
|
func Options() {
|
||||||
var (
|
var (
|
||||||
|
titlePos float32 = 10
|
||||||
|
titleForwardPos float32 = 45
|
||||||
|
|
||||||
centerPos float32 = 10
|
centerPos float32 = 10
|
||||||
backPos float32 = -application.WindowWidth + 10
|
backPos float32 = -application.WindowWidth + 10
|
||||||
forwardPos float32 = application.WindowWidth + 10
|
forwardPos float32 = application.WindowWidth + 10
|
||||||
|
|
||||||
rootPanelPos = true
|
rootPanel = true
|
||||||
controlsPanelPos = false
|
controlsPanel = false
|
||||||
graphicPanelPos = false
|
graphicPanel = false
|
||||||
|
|
||||||
rootPos = centerPos
|
rootPos = centerPos
|
||||||
controlsPos = forwardPos
|
controlsPos = forwardPos
|
||||||
graphicPos = forwardPos
|
graphicPos = forwardPos
|
||||||
|
|
||||||
|
titleControls = titleForwardPos
|
||||||
|
titleGraphics = titleForwardPos
|
||||||
)
|
)
|
||||||
// load resources here
|
// load resources here
|
||||||
|
|
||||||
|
@ -32,60 +38,62 @@ func Options() {
|
||||||
break
|
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.BeginDrawing()
|
||||||
raylib.ClearBackground(raylib.Black)
|
raylib.ClearBackground(raylib.Black)
|
||||||
|
|
||||||
raylib.DrawText("Options", 10, 10, 20, raylib.White)
|
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)
|
raylib.DrawLine(10, 40, 790, 40, raylib.White)
|
||||||
if gui.Button(raylib.NewRectangle(application.WindowWidth-110, 10, 100, 20), "Main Menu") {
|
if gui.Button(raylib.NewRectangle(application.WindowWidth-110, 10, 100, 20), "Main Menu") {
|
||||||
application.CurrentScene = application.SceneTitle
|
application.CurrentScene = application.SceneTitle
|
||||||
}
|
}
|
||||||
|
|
||||||
// ROOT PANEL FOR SETTINGS
|
// ROOT PANEL FOR SETTINGS
|
||||||
{
|
if gui.Button(raylib.NewRectangle(rootPos, 50, 100, 20), "Controls") {
|
||||||
if rootPanelPos {
|
rootPanel = false
|
||||||
rootPos = raylib.Lerp(rootPos, centerPos, 0.1)
|
controlsPanel = true
|
||||||
} else {
|
}
|
||||||
rootPos = raylib.Lerp(rootPos, backPos, 0.1)
|
if gui.Button(raylib.NewRectangle(rootPos, 80, 100, 20), "Graphics") {
|
||||||
}
|
rootPanel = false
|
||||||
if gui.Button(raylib.NewRectangle(rootPos, 50, 100, 20), "Controls") {
|
graphicPanel = true
|
||||||
rootPanelPos = false
|
|
||||||
controlsPanelPos = true
|
|
||||||
}
|
|
||||||
if gui.Button(raylib.NewRectangle(rootPos, 80, 100, 20), "Graphics") {
|
|
||||||
rootPanelPos = false
|
|
||||||
graphicPanelPos = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CONTROLS PANEL
|
// CONTROLS PANEL
|
||||||
{
|
raylib.DrawText("Controls", int32(controlsPos), 50, 20, raylib.White)
|
||||||
if controlsPanelPos {
|
if gui.Button(raylib.NewRectangle(controlsPos, 80, 100, 20), "Back") {
|
||||||
controlsPos = raylib.Lerp(controlsPos, centerPos, 0.1)
|
rootPanel = true
|
||||||
} else {
|
controlsPanel = false
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GRAPHICS PANEL
|
// GRAPHICS PANEL
|
||||||
{
|
raylib.DrawText("Graphics", int32(graphicPos), 50, 20, raylib.White)
|
||||||
if graphicPanelPos {
|
if gui.Button(raylib.NewRectangle(graphicPos, 80, 100, 20), "Back") {
|
||||||
graphicPos = raylib.Lerp(graphicPos, centerPos, 0.1)
|
rootPanel = true
|
||||||
} else {
|
graphicPanel = false
|
||||||
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.EndDrawing()
|
raylib.EndDrawing()
|
||||||
|
|
Loading…
Add table
Reference in a new issue