It looks like you're new here. If you want to get involved, click one of these buttons!
self:addEventListener(Event.KEY_DOWN, function(event) if (event.keyCode == Keycode.BACK) then local exitbuttonBoard = Bitmap.new(Texture.new("gfx/exitbutton bord.png")) exitbuttonBoard:setAnchorPoint(0.5,0.5) exitbuttonBoard:setPosition(480,320) self:addChild(exitbuttonBoard) local playOnBtn = myGButton.new("gfx/Play on.png","gfx/Play on hover.png") playOnBtn:setPosition(-142,-120) exitbuttonBoard:addChild(playOnBtn) local endGame = myGButton.new("gfx/end game.png","gfx/end gamehover.png") endGame:setPosition(-142,0) exitbuttonBoard:addChild(endGame) endGame:addEventListener("click",function() application:exit() --- quit the game end) playOnBtn:addEventListener("click",function() exitbuttonBoard:removeFromParent()---so user can continue to play where he had left end) end end) |
Comments
firstly, what does not work for you?
secondly, usually on back button you are either going back to previous scene, or closing any opened pop ups or simply exiting the app without any dialog to ask confirmation
the game quits on pressing back button i want this 3 images to show and wait for user input
so if the game quits, then you must have an application:exit() call somewhere else in your code
What did you do to get it to work?
thx
I don't remember what was the exact problem with me. what is problem with you can you describe that so we can help you also there is one example in Gideros installation directory for the back button that may also help you
Thanks