[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: 154
Reputation: 3,117

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
168
S
50
G
163
Posts: 8,220
Reputation: 105,059

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
82
S
39
G
15
Posts: 982
Reputation: 16,712

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: 154
Reputation: 3,117


Return to Construct 2 General

Who is online

Users browsing this forum: mehrshadfarahani and 1 guest