Disable invisible layer

Discussion and feedback on Construct 2

Post » Mon Jan 16, 2017 10:32 am

Another way of doing this, if you dont want to use groups, is to create a family where you put those 3 buttons and you can enable/disable collision. This is how I've done and it works fine.
B
40
S
10
G
9
Posts: 213
Reputation: 7,057

Post » Thu Jan 26, 2017 4:52 am

All you have to do to make invisible buttons work is have a parent event that says

"layer 1 is visible"
(sub event)------> on button click -> do stuff
B
88
S
44
G
16
Posts: 1,009
Reputation: 17,971

Post » Thu Jan 26, 2017 9:29 pm

When using a global layer. Can do this too.

https://www.dropbox.com/s/xm8z6dd2mrmyy ... .capx?dl=0

If you build the Menu with only sprites, (eventual using rex_Button) it can be done in 2 lines, using 1 family.

But, besides that, event groups do work flawless. If you need to know what you did wrong, then show what you did.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Feb 10, 2017 3:40 pm

@avengium, Did you import the eventsheet that activate/deactivate and take care of the "pause actions" of the global layer in all eventsheets of the other layouts?
B
18
S
4
G
1
Posts: 143
Reputation: 1,868

Post » Mon Feb 13, 2017 8:00 pm

@anty21ro, @justifun, @99Instances2Go @Frcol Thanks for your answers. :D
I forgot about this post so i read this today.
I resolved my problem making a variable for visible/invisible (sprites) and another variable for blocked/unblocked (group of events). So i update the two variables, and when i close the "pause menu" i update the visibility and the block.
B
9
Posts: 14
Reputation: 353

Post » Tue Mar 14, 2017 3:55 am

Hi!,
I had the same problem and I came here today.
Using groups worked fine. But, I think having to put two actions in order to hide/deactivate a popup window (for example) is not good for readibility.
I understand why is that and how construct deals separately sprites and events. But it should be a better way I think. Like having in some way the three options: (HIDE, DEACTIVATE and HIDE_AND_DEACTIVATE).

PD: I'm new to Construct2 so let me know if I'm misunderstanding something.

Saludos! :)
B
21
S
5
G
1
Posts: 13
Reputation: 1,729

Post » Tue May 30, 2017 10:10 pm

Softloulou wrote:Here is a Capx i have done for you to test.
By pressing " i " you can switch the visibility of the two buttons (it's the same logic if you ask if it's a sprite visibility or Layout / layer). The red button is clickable even when hidden (that's not what we want) but the blue one is only clickable when visible. And this, because i said : If button blue isn't visible then deactivate the group (where all the actions for the blue button are), this way you can easily make many actions, for various buttons inside a single group and deactivate the whole thing by only doing one check (the visibility).


Thank you - that was incredibly helpful.
B
4
S
1
Posts: 6
Reputation: 312

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests