Get access to device buttons

Get help using Construct 2

Post » Sun Feb 15, 2015 6:25 pm

Im using CocoonJS export for my Android game.
When I tap "back" button on my tablet, system asks me if I want to exit. This happens on every layout.
I want to change it.
How do I get access to the system device buttons and change its actions? For example, to create my own in-game context menu, which can be called with "options" button, and returning to the previous layout with "back" button.
Or maybe I can just turn it off?
You do not have the required permissions to view the files attached to this post.
B
38
S
15
G
6
Posts: 238
Reputation: 7,770

Post » Mon Feb 16, 2015 12:31 pm

bump
B
38
S
15
G
6
Posts: 238
Reputation: 7,770

Post » Mon Feb 16, 2015 1:22 pm

Hello!
CocoonJS doesn't support device buttons, it is necessary to export via Crosswalk/Cordova for Intel XDK or phonegap.

In this case you just need to add the Browser object to your project and use these events for your device's buttons:
Cattura di schermata (19).png
You do not have the required permissions to view the files attached to this post.
B
11
S
3
G
1
Posts: 91
Reputation: 997

Post » Wed Feb 18, 2015 1:01 pm

There exists a quite handy plugin to access the android back button when using cocoon.
Take a look at this thread and read through the end since the plugin needs some changes
before it will work (all explained in the thread)

plugin-cocoonjs-android-back-button_t92414
B
7
S
1
Posts: 41
Reputation: 525


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests