How do I make a pop-up menu when I right click an object?

0 favourites
  • 4 posts
From the Asset Store
Relax and relieve stress by popping bubbles in Fidget Anti- Stress Releaser!
  • I am making a tower defense game (and having a lot of fun doing it).

    My layout (level) consists of open squares (the enemy can move through) and solid squares (they cannot move through).

    I would like to be able to right click on a solid square object and have a pop-up menu open, where I can select a tower type and then have it appear on that square.

    I have searched, but have not found a game or tutorial, that seems to have a simple pop-up menu like this.

    Can someone point me in the direction of a game or tutorial, I could look at and learn from?

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There are different ways to do it, you just need to keep testing and see which one you like the most.

    Here some ideas:

    1-Create on the editor a Popup Panel and add all the tower animation frames available to the panel and place them in the right positions.
    
    2-Add also a Button to Close the panel
    
    3-(Create a Hierarchy between the frames + Close Button) and the Panel and make the panel as parent. And then on the "Tower frame Hierarchy settings", you need to tick:
    Transform (X & Y)
    Transform (Width & Height)
    
    Do the same for the close button
    
    
    4-Add to the panel the tween behaviour
    
    5-Add a Global variable "UID"
    
    6-On Tile clicked: 
    --------- Set "UID" to Tile.UID
    --------- Set the panel scale to 0
    --------- Set the panel XY in the middle of the screen or in the position that you like to appear on the screen
    --------- Panel start Tween size to scale back to its original size
    
    7-On Tower animation frame clicked:
    ---------- Pick Tile by UID and enter the Global variable "UID"
    --------------- Tile Spawn Tower 
    --------------- Tower set animation to "Tower animation frame" that you clicked or use a variable to know which tower you need to spawn
    
    
    
    8-On button Close Touched: ------- Panel tween Scale again to 0 to close it and hide it when the tween finishes
    

    That's the basics you need to get started.

  • These are great suggestions!

    I will try these out and see what works best.

    Thank you so much.

  • There's also this example project utilizing the HTML Element

    editor.construct.net

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