From 8c7dfa2167ca737e33947b98ed6c077351f6a2b6 Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Thu, 12 Jun 2025 20:22:40 +1200 Subject: Button is work, very very nice --- assets/scripts/mainMenu.lua | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'assets/scripts') diff --git a/assets/scripts/mainMenu.lua b/assets/scripts/mainMenu.lua index 2f6b342..d08d82a 100644 --- a/assets/scripts/mainMenu.lua +++ b/assets/scripts/mainMenu.lua @@ -1,18 +1,29 @@ movementSpeed = 3; bannerTextureWidth = 509; +buttonHeight = 50; +buttonWidth = 110; +bigButtonWidth = 150; +bigButtonHeight = buttonHeight; function Setup() setRenderPlayer(false) setBgImage("assets/backgrounds/city-background-1.png") end -function TestButtonFunction() - setBgImage("assets/gui/mainMenu_banner.png") +function Local2PButton() +end + +function MultiplayerButton() +end + +function SettingsButton() end function Update() queueTextureForRender("assets/gui/mainMenu_banner.png", WIDTH // 2 - bannerTextureWidth // 2, 0) - queueButtonForRender("Local 2P", 0, 0, 100, 50, "TestButtonFunction"); + queueButtonForRender("Local 2P", WIDTH // 2 - buttonWidth // 2, HEIGHT // 2 - buttonHeight // 2, buttonWidth, buttonHeight, "Local2PButton"); + queueButtonForRender("Multiplayer", WIDTH // 2 - bigButtonWidth // 2, HEIGHT // 2 - bigButtonHeight // 2 + 55, bigButtonWidth, bigButtonHeight, "MultiplayerButton"); + queueButtonForRender("Settings", WIDTH // 2 - buttonWidth // 2, HEIGHT // 2 - buttonHeight // 2 + 55 + 55, buttonWidth, buttonHeight, "SettingsButton"); -- if keys[getKeycodeByName("RIGHT")] or keys[getKeycodeByName("D")] then -- movePlayer(movementSpeed, 0) -- cgit v1.2.3