[Feature request/suggestion] Stop tap/click from propagating

Discussion and feedback on Construct 2

Post » Tue Jul 19, 2016 5:46 pm

Hi.

It would be really useful to have a simple way of stopping taps/clicks from propagating to lower objects or layers.
Whenever you have an on-screen toolbar or menu or a pop-up it is always a hassle to set up control variables to stop buttons from activating what's below them when tapped.

Now to think of it, triggering the whole stack of overlapping objects is hardly ever the desired result.

Just as an example, in Corona SDK you can "return true" in the click listener of an object, which, upon receiving it, immediately breaks the click event (thus it not triggering in any object below).

I'm not sure if it is possible due to how touch/mouse events work in Corona, but it would be a very handy little feature.
B
16
S
7
G
1
Posts: 161
Reputation: 3,131

Post » Tue Jul 19, 2016 7:04 pm

Make a variable call it canbeclicked, set it to 0.
Make a variable comparison, variable canbeclicked =1 do stuff
Set the things you want to be clickable to 1
If they are different objects use a family variable.

Otherwise you would go by the zorder...
Image ImageImage
B
169
S
50
G
174
Posts: 8,330
Reputation: 110,804

Post » Tue Jul 19, 2016 9:18 pm

or just use a second AND condition "is on top"

it will only pick the top most object
B
87
S
44
G
16
Posts: 1,005
Reputation: 17,938

Post » Tue Jul 19, 2016 10:01 pm

@newt Yeah, that's what I meant by it's a hassle. When there are quite a few overlapping buttons/clickable object which change position it adds considerably to the development time to check and un-check things like a 'clickable' variable. Just thought it would be more convenient to just set a non-propagation property in the inspector or something.

@justifun Well that might come in handy! Thanks, I haven't thought of that.
B
16
S
7
G
1
Posts: 161
Reputation: 3,131


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests