TD: How to toggle display ONLY on a single unit

Get help using Construct 2

Post » Sat Jul 06, 2013 8:01 pm

Hello everyone!

I'll cut to the chase: I've read for a while and searched but I couldn't find a real solution to an issue I'm encountering here.

I'm making a TD, and I'm starting with the deployment system. I'm making it with an isometric view, already sorted out many things. But I'm having a problem with the display of the units. I want to select a unit, and it should display the range, and upgrade button and a sell button. I made a container, and a local variable to set if it's selected or not, and depending on that if it displays it. But the thing is that I want only one to be selected, if I select another one it should turn the others off. Here's a graphic example, the events and the capx.

Thanks!





Deploy and Display Info
B
15
S
6
G
3
Posts: 35
Reputation: 3,982

Post » Sat Jul 06, 2013 9:14 pm

Update: I have found a solution, I don't know if it will bring future problems, but as for now is actually better since I'm not spawning new objects and have to hide them. It has less events I think.



I'm sure it simple, but yet I can't find a way to call the funcion OnScreenReset when I touch the background. If I add an event that triggers when it touches the BG, then nothing works.

Any ideas?

Here's the updated capx

Deploy and Display 2

Edit: I've found the way to do it, just a simple fix. Here it is:



That leaves everything (as for today ) fixed.

Maybe this will help someone.lukedirago2013-07-06 21:43:32
B
15
S
6
G
3
Posts: 35
Reputation: 3,982


Return to How do I....?

Who is online

Users browsing this forum: BackendFreak, imhotep22, LaurenceBedford, yodashii and 6 guests