2022-04-11 18:47:26 +02:00
|
|
|
local Dim = require("common.dimensions")
|
|
|
|
local Wallpaper = require("components.wallpaper")
|
|
|
|
local BootPage = require("titlescreen.pages.boot.bootpage")
|
|
|
|
local PageView = require("components.pager.pageview")
|
|
|
|
|
2022-04-27 02:40:22 +02:00
|
|
|
local bootpage = BootPage.new()
|
|
|
|
local pageview = PageView.new(bootpage)
|
2022-04-11 18:47:26 +02:00
|
|
|
|
|
|
|
local function render(deltaTime)
|
|
|
|
Dim.updateResolution()
|
|
|
|
|
|
|
|
Wallpaper.render()
|
|
|
|
|
|
|
|
Dim.transformToScreenSpace()
|
|
|
|
|
|
|
|
pageview:render(deltaTime)
|
2022-04-15 04:54:30 +02:00
|
|
|
|
|
|
|
--pageview will be empty when you `back()` out of the root page
|
|
|
|
if not pageview:get() then
|
|
|
|
return {eventType = "switch", toScreen = "splash"}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
local function onButtonPressed(button)
|
|
|
|
pageview:get():handleButtonInput(button)
|
2022-04-11 18:47:26 +02:00
|
|
|
end
|
|
|
|
|
2022-04-15 04:54:30 +02:00
|
|
|
return {render = render, onButtonPressed = onButtonPressed}
|