Overlayed sprites, on click event

Get help using Construct 2

Post » Mon Jul 01, 2013 1:39 pm


I have a problem with the click event on overlayed sprites.
I have a sprite that works as a background of a section of the page, with other several sprites over that background: every time I click on the background an error function should be triggered, if I click on another sprite, instead, e success function should be triggered.

The problem is that the click event trigger the success function AND the error function.

I figured out some tricks to avoid this, such as write a condition like
"click on background
not click on other sprites"

In this case the actions should be performed only if the click event was triggered on the background only.

In any case this fix isn't a real solution, because if I have a lot of different sprites with several different functions the amount of conditions will increase very badly.

Is there any way to stop the propagation of an event only to a given sprite?

I simply want specify a set of actions to be performed if the top sprite is clicked and a different set of actions to be performed if only the background sprite is clicked.

Any ideas?

Thank you
Posts: 1
Reputation: 152

Post » Mon Jul 01, 2013 2:29 pm

There is a condition "Pick top/bottom instance", but it works only for 1 type of object at a time. In your case, you should do something like this.
Just specify what object you want to pick first, else the next one, ...
Posts: 473
Reputation: 6,311

Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 4 guests