How do I get a click event for top sprite

Just started using Construct 2? Post your questions here

Post » Fri Aug 28, 2015 11:39 am

Have overlapping sprites, I only want the 'on object clicked' to fire for the top most one, currently it fires for every object under the mouse. EX: Clicking on a UI elements still fires the click event for the background object.
B
6
S
1
Posts: 14
Reputation: 330

Post » Fri Aug 28, 2015 12:55 pm

ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Fri Aug 28, 2015 1:54 pm

I should have said, the two overlapping images are different objects types, not different instances of the same object. One is a 9-split and one is a tile grid. I really did spend about an hour searching google for an example on how to do it. I think I can make it work with a global variable and an on tick event, but I was hoping for a more elegant solution.
B
6
S
1
Posts: 14
Reputation: 330

Post » Fri Aug 28, 2015 2:46 pm

That's pretty much what you have to do.
ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Fri Aug 28, 2015 3:38 pm

Ok, thanks. I will test when I get home and let you know.
B
6
S
1
Posts: 14
Reputation: 330


Return to Beginner's Questions

Who is online

Users browsing this forum: papnikol and 3 guests