...disable a layer?

Get help using Construct 2

Post » Wed Aug 21, 2013 12:57 am

I have a UI layer that contains instructions, a start button, and a back button to cancel back to the main menu... When they press start, I set the layer to be invisible, but the buttons are still active. Once click in the wrong place and whammo... bounce out of the game.

Can I disable an entire layer so its objects don't respond to events anymore?

B
22
S
4
G
1
Posts: 100
Reputation: 2,150

Post » Wed Aug 21, 2013 1:07 am

Yeah if the objects are invisible they will still remain active. I am currently a fan of putting things like inventory logic into a group and using the action 'Set Group Active' to deactivate all logic in the group in addition to making the stuff invisible.
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Wed Aug 21, 2013 4:49 am

Excellent...thanks
B
22
S
4
G
1
Posts: 100
Reputation: 2,150

Post » Wed Aug 21, 2013 10:14 am

@plinkie

you have some sample?

my deactivate and activate is not working...

im developing tower defense game in touch devices.

i used deactivate and activate in per waves like
per spawn of enemy..

help pls...
Thanks!:)
B
9
S
2
Posts: 82
Reputation: 914

Post » Wed Aug 21, 2013 11:08 am

@karlmahmen
send me a .capx and I will check it
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Wed Aug 21, 2013 12:18 pm

@plinkie

Okay.Thanks! :)
B
9
S
2
Posts: 82
Reputation: 914

Post » Thu Sep 12, 2013 3:03 pm

When you say set the "group" to active, do you mean an Event Group, a Family, or a Container?
B
34
S
12
G
3
Posts: 91
Reputation: 4,725

Post » Thu Sep 12, 2013 3:28 pm

Group would suggest he meant event group.

Just put all events relating to the layer in an event group and set group to active/inactive based on layer visibility.
You could also add an if layer is visible condition to all events related to the layer.LittleStain2013-09-12 15:28:46
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


Return to How do I....?

Who is online

Users browsing this forum: David181, OBLIVION, senecaa, Yahoo [Bot] and 18 guests