Mouse click - Superimposed sprites

Get help using Construct 2

Post » Sun Jul 22, 2012 8:37 pm

How about if you add a counter that registers how many objects are clicked, and only do the "Pick top" action if there's more than 1?
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Jul 22, 2012 8:47 pm

what i did was to use the ELSE command and start checking ALL sprites from top to bottom. that way the first one that hits is always on top.

however i would have preferred to use Families as it was a more elegant option.
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Post » Sun Jul 22, 2012 9:08 pm

I just tested, if you do it like ramones said it works. It selects only the top sprite of the sprites clicked.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Jul 22, 2012 9:42 pm

yes it works, but it ALWAYS selects the top sprite, no matter on which sprite you click!

i want to be able to ALSO select the sprite in the middle (of 3 sprites on top of each other), if i click on the middle one!
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Post » Sun Jul 22, 2012 10:00 pm

Do you mean if they are on top of each other and completely covering the sprites underneath, or just overlapping? If it's the first case, how would you choose which sprite to pick? If it's the second, it should work.

Here's my test project if you're interested: PickTopFamily.capx (r99)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Jul 22, 2012 10:12 pm

Nimtrix, yes exactly like in your example.

works 100% in your case.

i will have to check again my project & see what i did wrong.

thanks a lot
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Previous

Return to How do I....?

Who is online

Users browsing this forum: emoticon, KeetonCat, makkancs and 24 guests