Using Back button on phone to exit game via Crosswalk?

Get help using Construct 2

Post » Wed Sep 17, 2014 7:08 pm

As the title says, Is there a way of making my app/game detect when the phone Back button is pressed to exit the game? I've used CocoonJS before and that works fine but doesn't do anything with Crosswalk, is this something you have to enable?
Image ImageImage
B
6
S
2
G
1
Posts: 87
Reputation: 1,206

Post » Wed Sep 17, 2014 8:22 pm

im curious about that too!
didnt find anything in the xdk, i made a work around that uses a sprite in game "on touched sprite->Browser-close" but thats not really cool
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

Post » Wed Sep 17, 2014 8:31 pm

I can't understand, i have galaxy s3 and when i press back button in my games made with crosswalk, they are closing. And theres an action in browser "On back button released" or something like that.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Thu Sep 18, 2014 2:10 pm

I've found the 'On mobile back button pressed' action and used that to close browser. Must admit, not a fan of that as what happens is that as you press the back button, the screen turns white and then closes.

Much prefer the CocoonJS way, where is asks if you want to exit when pressing the back button and doesn't have the white screen. It looks more professional that way.

I find it odd that having the back button to exit isn't automatically there with Crosswalk, it just seems something normal to have with all apps.
Image ImageImage
B
6
S
2
G
1
Posts: 87
Reputation: 1,206

Post » Thu Sep 18, 2014 2:14 pm

I would suggest making your own exit menu and get the back button to spawn that and then get it to close when they tap/click/press yes?
B
7
Posts: 61
Reputation: 417

Post » Thu Sep 18, 2014 2:18 pm

Yeah i've actually tried that but i don't like the way it closes because, as mentioned before, the game turns to a white screen and then closes. It doesn't look great to be honest.
Image ImageImage
B
6
S
2
G
1
Posts: 87
Reputation: 1,206

Post » Thu Sep 18, 2014 2:22 pm

Ah I see, sorry I thought you just meant the menu not appearing. I've never tried the close browser command myself, I will take a look tonight and see if it does the same for me.
B
7
Posts: 61
Reputation: 417

Post » Fri Sep 19, 2014 7:49 am

RandomOutput wrote:I would suggest making your own exit menu and get the back button to spawn that and then get it to close when they tap/click/press yes?


In my opinion, that's the best solution: I hate when mobile games just "close" and I don't know if they're still running in background (that is, leeching memory) or they have correctly quit.
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
30
S
12
G
4
Posts: 141
Reputation: 4,782

Post » Fri Sep 19, 2014 9:32 am

@rayray i don't seem to be having any problem with closing. It closes very smoothly on my moto e without a white screen and on the nexus 7 too
B
15
S
3
G
1
Posts: 111
Reputation: 1,664

Post » Fri Sep 19, 2014 10:58 am

I've just tried it again it's working fine now. It closes smoothly and there's no white screen. I have no idea why it's working fine now and it wasn't before. I tried at least 6 or 7 times before and always had that white screen. Hope it stays that way :)

Thanks for the replies.
Image ImageImage
B
6
S
2
G
1
Posts: 87
Reputation: 1,206

Next

Return to How do I....?

Who is online

Users browsing this forum: David181, InfiniteRockets, marcinkowski, Yahoo [Bot] and 15 guests