[Solved] How I pick one sprite on click/touch event from ove

Get help using Construct 2

Post » Mon Jun 01, 2015 3:02 pm

Greetings

I have 2 overlapping square sprites. They overlap only in a corner.

I also got an click or on touched object event. This event fires for both of the sprites if I click in the corner even though, in my opinion it should fire for the sprite on top.

Image

Thanks anticipated.
Last edited by Je Fawk on Mon Jun 01, 2015 3:21 pm, edited 1 time in total.
Black Bobby The Hole Greenlit with 303 votes.
B
35
S
8
G
1
Posts: 163
Reputation: 2,979

Post » Mon Jun 01, 2015 3:10 pm

hi
so you actully click on both sprites you see the top one but the other one still there! this is not a bug
after clicking you can select your top sprite
B
16
S
6
Posts: 243
Reputation: 1,755

Post » Mon Jun 01, 2015 3:11 pm

It's not a bug..

If both sprites are instances of eachother you can use the condition Sprite pick top/bottom

Otherwise you can do this by putting both sprites in a family and using that condition..

Third option is comparing the sprite.Zindex to pick the top or bottom one..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jun 01, 2015 3:14 pm

Thank you very much @LittleStain

I'll be using pick top/bottom
Black Bobby The Hole Greenlit with 303 votes.
B
35
S
8
G
1
Posts: 163
Reputation: 2,979


Return to How do I....?

Who is online

Users browsing this forum: bluesun66, Yahoo [Bot] and 11 guests