more modular menu

This commit is contained in:
Alexey 2025-10-23 14:47:00 +03:00
commit 7df0478890
6 changed files with 178 additions and 117 deletions

24
menu/common.lua Normal file
View file

@ -0,0 +1,24 @@
require 'point'
require 'button'
local buttonTopPos = Point:new( 240, 160 )
local buttonBotPos = Point:new( 240, 280 )
local buttonSize = Point:new( 320, 80 )
local titlePos = Point:new( 240, 80 )
return {
buttonTopPos = buttonTopPos,
buttonBotPos = buttonBotPos,
buttonSize = buttonSize,
titlePos = titlePos,
exitToMenuButton = Button:new(
buttonBotPos,
buttonSize,
'Return to menu',
nil,
nil,
function()
Menu.current_state = MenuStateIndex.start
end
)
}