hi there, so i created gameover.lua to be shown as “pop up” when the player hits a bomb, with this code:
director:openPopUp (Param,"gameoverPopup", popClosed)
then in gameoverPopup, i can use this code to go back:
local touched = function ( event )
if event.phase == "ended" then
director:closePopUp()
end
end
but i wonder why i cant add the usual director.changeScene in specific button there in gameoverPopup.lua?
i have this one to replace the above code:
local function onClickMenuButton (event)
if event.phase == "ended" then
director:changeScene ("menu")
end
end
menuButton:addEventListener ("touch", onClickAboutButton)
but it simply doesnt work.
How to add a button in a pop up file but it would still work normally like the usual director:changeScene in normal lua page? [import]uid: 114765 topic_id: 24799 reply_id: 324799[/import]