ExperimentalGear/scripts/titlescreen/service.lua

102 lines
2.2 KiB
Lua
Raw Normal View History

2021-12-20 00:39:38 +01:00
local triggerSplashScreen = false
local menu = {
{
label = 'IDOLS',
handler = function () return end;
children = {
{
label = 'TEST'
}
}
},
{
label = 'LASER COLORS',
handler = function () return end;
children = {
{
label = 'TEST'
}
}
},
{
label = 'MORE OPTIONS',
handler = function () return end;
children = {
{
label = 'TEST'
}
}
},
{
label = 'OH YOU SUSSY BAKA',
handler = function () return end;
children = {
{
label = 'TEST'
}
}
},
{
label = "GAME MODE",
handler = function ()
triggerSplashScreen = true;
end
}
}
local index = 1;
render = function (deltaTime)
gfx.BeginPath();
gfx.FillColor(0,0,0,255);
gfx.Rect(0, 0, 1080, 1920);
gfx.Fill();
gfx.LoadSkinFont("dfmarugoth.ttf")
gfx.FillColor(255,255,255,255);
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE)
gfx.FontSize(24);
gfx.BeginPath();
gfx.Text('SERIVCE MENU', 1080/2, 128);
gfx.Text('BT-A/BT-B = GO UP/DOWN', 1080/2, 1920-256-28);
gfx.Text('START = SELECT', 1080/2, 1920-256);
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
for i, menuItem in ipairs(menu) do
if (i == index) then
gfx.FillColor(0,255,0,255);
-- gfx.FillColor(0,128,255,255);
else
gfx.FillColor(255,255,255,255);
end
gfx.BeginPath();
gfx.Text(menuItem.label, 100, 256+i*28);
end
if (triggerSplashScreen) then
triggerSplashScreen = false;
return {
eventType = 'switch',
toScreen = 'splash'
}
end
end
local onButtonPressed = function(button)
if button == game.BUTTON_STA then
menu[index].handler();
elseif button == game.BUTTON_BTA then
index = index - 1;
elseif button == game.BUTTON_BTB then
index = index + 1;
end
end
return {
render = render,
onButtonPressed = onButtonPressed
}