add clear() to PageView

This commit is contained in:
Hersi 2022-04-24 01:38:28 +02:00
parent 9cab4201c6
commit eb55b8ffa0
1 changed files with 9 additions and 5 deletions

View File

@ -51,11 +51,7 @@ end
---Replace the current pageStack with a new root page
---@param rootPage Page
function PageView:replace(rootPage)
--clear pageStack
while self:get() do
self:back()
end
self:clear()
self:navigate(rootPage)
end
@ -70,6 +66,14 @@ function PageView:back()
popStack(self.pageStack)
end
---Clear the pageStack
function PageView:clear()
--clear pageStack
while self:get() do
self:back()
end
end
---@param deltaTime number # frametime in seconds
function PageView:render(deltaTime)
if self:get() then