How do I make click events work *only* on top sprites?

Get help using Construct 2

Post » Thu Jul 30, 2015 2:19 am

When two sprites overlap and I click with the mouse in the overlapping area, both sprites receive a click event. As it is now I sometimes get click events for sprites that I cannot even see because they are completely obscured behind another sprite.

How can I make it so that only the top-most (or front most) sprite gets a click event?
B
6
S
1
Posts: 10
Reputation: 420

Post » Thu Jul 30, 2015 5:40 am

If all of your objects are in a family, you can do this

on touched "FamilyOfObjects"
(second condition) Pick Top Instance -> FamilyOfObjects - set opacity to 50

it will only pick the highest object in the stack that was touched.

Pick top/bottom instance is found in the very bottom right of the event actions btw.
B
87
S
44
G
16
Posts: 1,005
Reputation: 17,938

Post » Fri Jul 31, 2015 2:44 am

@justifun Perfect! Thanks for your help.
B
6
S
1
Posts: 10
Reputation: 420


Return to How do I....?

Who is online

Users browsing this forum: adventurist, Artcadev, Blendi1223, PROxMTswatTR, zenox98 and 25 guests