How do I disable click on lower window when a upper window

Get help using Construct 2

Post » Mon Oct 27, 2014 4:07 pm

How can I disable windows that are overlapping.

In my game there are message windows that overrides other windows.
When this message window is displayed, the buttons on the bottom screen can be clicked.
How can I disable the lower windows when the top is displayed?

Ex: A window to purchase items that show a message to purchase made and disables the click of items in window.

Thanks in advance an sorry about my poor english. English is not my first language.
B
15
S
2
Posts: 5
Reputation: 984

Post » Mon Oct 27, 2014 5:48 pm

Turn collision for them off when you don't want them active and visibility off when you don't want them seen.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
71
S
19
G
8
Posts: 640
Reputation: 9,701

Post » Mon Oct 27, 2014 7:10 pm

@chrisinfinger

Does turn off collision works if the window is only sprite ?
Or i need to set another behaviour specific ( like solid , for ex ) for this ?

Thanks
B
15
S
2
Posts: 5
Reputation: 984

Post » Mon Oct 27, 2014 8:01 pm

One solution would be to hide the layer (set layer invisible) with the buttons underneath and have the top sprite on a separate layer.

What I was referring to earlier was for you to turn off the collision for the buttons underneath when the top sprite is displayer (a button only works if its collision is enabled) and if you also want them to disappear when the top sprite is displayed to set them invisible as well when top one is active. Reverse process when top sprite is closed.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
71
S
19
G
8
Posts: 640
Reputation: 9,701

Post » Mon Oct 27, 2014 8:42 pm

one way to do it would be to create a global variable (eg POPUP_ACTIVE) that disables the buttons if set.. so when your popup appears, set this value to 1 (for example) and then use the following conditions. When the popup is disabled, set the variable back to zero

if OBJECT clicked
if POPUP_ACTIVE not equal to 1
<do what you want now>

that way if they are clicked, you won't do anything.
B
7
S
3
G
1
Posts: 184
Reputation: 1,352

Post » Mon Oct 27, 2014 9:16 pm

By far my favorite way to do this is put the events in groups and activating/de-activating the groups when needed..
So all clicks/touches concerning anything other than the menu-clicks would be in a de-activated group..
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 Oct 28, 2014 12:03 am

thanks for all reply.

i will try all methods described here and see what is the best for my case.

Thanks again
B
15
S
2
Posts: 5
Reputation: 984


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests