How do I disable mouse clicks for invisible objects?

Get help using Construct 2

Post » Tue Apr 21, 2015 12:22 pm

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?
B
17
S
7
Posts: 277
Reputation: 2,514

Post » Tue Apr 21, 2015 12:48 pm

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Apr 21, 2015 2:02 pm

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 :)
B
17
S
7
Posts: 277
Reputation: 2,514


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 6 guests