It is time to add some menu functionality to Clay Bang. I had followed a previous tutorial creating some buttons and running them in main.lua
This is good, but I want these to be centered. These are my three buttons in menu.lua
. They will help with state management too.
self.buttons = {
{text = "Start Game", x = 100, y = 100, width = 200, height = 50, action = function() State = "play" end},
{text = "Settings", x = 100, y = 200, width = 200, height = 50, action = function() State = "SettingsMenu" end},
{text = "Quit", x = 100, y = 400, width = 200, height = 50, action = function() love.event.quit() end},
}
In games, you are able to resize your window to different resolutions. How am I supposed to click if I only have a 30x30 monitor?