TD: How to toggle display ONLY on a single unit

0 favourites
  • 2 posts
From the Asset Store
Make a displayed number gradually increase or decrease, making an impression of a real-time counting.
  • 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!

    <img src="http://i.imgur.com/j1trEVR.jpg" border="0">

    <img src="http://i.imgur.com/jid1OVt.jpg" border="0">

    Deploy and Display Info

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

    <img src="http://i.imgur.com/MIDms7Y.jpg" border="0">

    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:

    <img src="http://i.imgur.com/NLxqZIG.jpg" border="0">

    That leaves everything (as for today <img src="smileys/smiley2.gif" border="0" align="middle"> ) fixed.

    Maybe this will help someone.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)