anyone tried to use overlay for pause button ?
I’m trying to use the overlay scene as popup scene showing over the Level which I pressed Pause on.
and I have three buttons on this Popup scene
HOME
RESUME
REPLAY
HOME which will redirect me to home scene ( it works well )
RESUME which will resume the level from where I pressed the pause button ( it works well too )
REPLAY, which will reload the level where I pressed the pause button, and still don’t know if overlay support this or not
i tried to remove/purge the level in popup scene and it give me error on destroyScene()
code from level
function btnPause\_touch(e)
if e.phase == "ended" then
-- do Splash Back Next Replay Resume
storyboard.showOverlay("pausePopup",{effect = "fade",time = 400})
end
end
btnPause:addEventListener("touch",btnPause\_touch);
and in pausePopup scene
function btnReplay\_touch(e)
if e.phase == "ended" then
--storyboard.hideOverlay( true, "fade" )
--storyboard.removeScene("lvl1")
--storyboard.gotoScene("lvl1","fade",400);
end
end
btnReplay:addEventListener("touch",btnReplay\_touch);
does anyone know the right way to do it ?
[import]uid: 138983 topic_id: 28796 reply_id: 328796[/import]