This commit is contained in:
MihailRis
2025-08-07 22:37:40 +03:00
parent 0a02d3fbec
commit 9fcff65cca
5 changed files with 31 additions and 18 deletions
+16 -8
View File
@@ -1,13 +1,13 @@
local menubg
function on_screen_changed(screen)
if screen ~= "menu" then
if menubg then
menubg:destruct()
menubg = nil
end
return
local function clear_menu()
if menubg then
menubg:destruct()
menubg = nil
end
end
local function configure_menu()
local controller = {}
function controller.resize_menu_bg()
local w, h = unpack(gui.get_viewport())
@@ -19,8 +19,16 @@ function on_screen_changed(screen)
end
_GUI_ROOT.root:add(
"<image id='menubg' src='gui/menubg' size-func='DATA.resize_menu_bg' "..
"z-index='-1000' interactive='true'/>", controller)
"z-index='-1' interactive='true'/>", controller)
menubg = _GUI_ROOT.menubg
controller.resize_menu_bg()
menu.page = "main"
end
function on_screen_changed(screen)
if screen ~= "menu" then
clear_menu()
else
configure_menu()
end
end