How do I disable mouse clicks for invisible objects?

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hello friends, I'm trying to develop a upgrade tree menu. It consists of a upgrade tree :0 that scrolls up and down, and there is the HUD in the bottom of the screen on which the player will check the price of the upgrade and access the "buy" button, and "home" button, as well as the "up" and "down" buttons that will move the upgrade screen.

    My problem is: Even though the upgrades buttons are under the HUD, the player is still able to click on it, and since there are buttons on the HUD, both the buttons on the HUD and those under it are being activated at the same time.

    You can see how this is not a good thing.

    So, what do I need to do in order to make the HUD "solid" (Not solid because I already tried that and it didn't work) in a way that the buttons underneath it cannot be accessed?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There are many ways to do this depending on how you have your events set up.

    Are all buttons instances of the same sprite or are they seperate objects.

    Do you change to the hud with a global variable or is it a layer that becomes visible?

    In any case it would either be adding a condition to the on clicked/on touched event, or putting the events in a group and deactivating the group when the hud is shown.

  • Since the buttons go up and down I put a condition that allows only buttons with the shown area to be "clickable", so it's working for now.

    Thank you very much

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