How do I block tapping for an object

Get help using Construct 2

Post » Mon Mar 16, 2015 10:40 am

hello
I have level buttons on one screen , if you rtouch each of them it will send you to the right layout

howeve i want them to be locked unless a condition happens
for that i create on layer a large button that is hiding them however if you touch on that area where the buttons are (below of that layer) they can are still active

Is there a simple way to block tapping on all objects on a specific area ?
B
8
S
2
Posts: 130
Reputation: 970

Post » Mon Mar 16, 2015 10:51 am

As I can understand the problem is that you can click object on hidden layer? And you want to avoid this.

There are 2 ways I use to pass this around:
1) Use Groups in Event Sheet. So you can activate and deactivate them whenever you want. It means - use special groups for layouts for events you need only when this layout is visible. May not works if you need both layers to show visible and this situation appears.
2) The second way is to use Is on layer? and Is layer visible? conditions.

Maybe there are other ways I never used.
B
8
S
1
Posts: 72
Reputation: 606

Post » Mon Mar 16, 2015 11:03 am

Like NickRimer says, use groups.

Add your on click actions to a group, and enable disable this group when needed.

Another option could be to give them booleans to set them active.

Or

If you have a layer appearing above the buttons, you could add a condition to the onclick action

event
onclick button
layer "layerabovebutton" is not visible (inverted)
action
etc


The latter will only be clickable if the layer above it is invisible.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,567

Post » Mon Mar 16, 2015 11:41 am

great guys, many thanks that was really helpful
B
8
S
2
Posts: 130
Reputation: 970


Return to How do I....?

Who is online

Users browsing this forum: plinkie, rayolf, SashikLV and 7 guests