Jump to content

Build Android (apk) game with phaser


Ruhul Amin
 Share

Recommended Posts

i am new in phaser and successfully made a game.But the problem i faced is when i compile it with phone gap or intel XDK the the phone button like backbutton doesn't work properly.The whole game exit in one press of back button. I want to use a confirmation massge like "Do you want to exit " like general app does.After conformation the game will exit.How can i do this?...It will be very kind of you and helful if you answer  ...Thanks in Advance.

Link to comment
Share on other sites

You can put the event handler anywhere.

I recommend creating it as soon as possible, and only once.

Just put these lines where you need:

document.addEventListener("backbutton", onBackKeyDown, false);

function onBackKeyDown() {
    // Handle the back button
}

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...