toggle view for all instances of object

Get help using Construct 2

Post » Thu Apr 12, 2012 4:12 pm

Hi, I have multiple cloned objects on the layout. I am trying to figure out how once one of these is clicked, they are set to invisible (which i can do) but if any of the cloned objects are already invisible, they are then made visible (so there is only one invisible instance at a time)?

Is there anyway i can do this?


regardslukesnowden2012-04-12 16:13:37
B
4
Posts: 16
Reputation: 432

Post » Thu Apr 12, 2012 5:55 pm

You may need to store the UID of the last invisible instance in a global variable, and 'pick by unique ID'.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,644

Post » Thu Apr 12, 2012 6:21 pm

Perfect place to use for each.
I would do something like:
>On sprite clicked, wait 1 second set opacity to 0
->for each sprite
-->sprite compare opacity <1, sprite set opacity to 100newt2012-04-12 18:25:54
Image ImageImage
B
165
S
49
G
146
Posts: 8,034
Reputation: 96,058

Post » Thu Apr 12, 2012 8:20 pm

Cheers all. For anyone looking:

lukesnowden2012-04-12 20:21:11
B
4
Posts: 16
Reputation: 432


Return to How do I....?

Who is online

Users browsing this forum: Elliott, hntr, LeirSchiessl, michaelverdi, wiredcleric and 9 guests