How do I control Touches

Get help using Construct 2

Post » Tue Sep 16, 2014 8:23 pm

Playing with mobile development. I have a problem when using touch and selecting submenus. For example,

There are several sprites on screen, any one of them can be selected. I touch one and it brings up an interactive menu, or sprite representing such a menu. The problem is if I touch this menu and there is a selectable sprite underneath, it may also get selected. Is there a way to avoid this using layers or someway where touch is enabled for only certain objects at a time? Hoping to get a few quick suggestions so I can get back on track.
B
10
S
2
Posts: 76
Reputation: 987

Post » Tue Sep 16, 2014 8:44 pm

This could be handled multiple ways..

You could add conditions for is on layer, z-order, visibility or add a boolean instance variable selectable=true and check that..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 16, 2014 8:55 pm

Thank you for the input. I was using a boolean on the selectable sprites, I foresaw a problem when I noticed that they could be re-selected whilst overlapped by the menu, resulting in a possible change of that menu relating to the previously selected sprite. I need to narrow the condition better, like passing another variable from the sprite to the menu while it is visible so that in this instance of visibility, the menu only affects the previously selected sprite. I think...
B
10
S
2
Posts: 76
Reputation: 987

Post » Tue Sep 16, 2014 8:57 pm

Be sure to use else statements..
There's a big chance multiple events are true at the same time and the last one will be executed..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: Magistross, mtnboy22, Rable and 8 guests