gotolayout and layer visibility not working

Get help using Construct 2

Post » Fri Feb 10, 2017 5:32 pm

Can anyone tell me why when going from one layout to another, setting a layer to invisible does not work.
Here is the set up:
layout story - has several layers. one is called "intro" on is called HUD
layout review

the story layout has some animations and events going on. At the end we click to go to review layout.
I get a menu slide in by clicking a button from HUD.
This menu has several buttons. Each one send you back to the layout 'story' but now I want the layer intro not showing and be deactivated.

I tried the code on the review layout event sheet and i tried the code in story layout event sheet since it is HUD global variable I think it does not make any difference.
The code on HUD buttons is:
gotolayout story
hide layer intro
deactivate intro group
set player x position to 300

Unfortunately it goes to layout Intro but does not hide the layer intro.
B
8
S
1
Posts: 86
Reputation: 618

Post » Fri Feb 10, 2017 6:00 pm

You need to go to the layout, and then 'On start of layout', do the rest of the commands. You can't affect the other layout - you have to go there first.
ImageImageImage
B
71
S
21
G
232
Posts: 3,696
Reputation: 129,868

Post » Thu Jun 08, 2017 4:51 pm

I just saw your answer. So I guess it does not work when you are using one event sheet for all the layouts.

You will always need to have an event sheet for each layout for some code that is very specific like go to layout and on start of layout.
B
8
S
1
Posts: 86
Reputation: 618

Post » Thu Jun 08, 2017 5:06 pm

That's the easiest/cleanest way, but you can also use System.LayoutName to get the current layouts name, to do specific code that way.
ImageImageImage
B
71
S
21
G
232
Posts: 3,696
Reputation: 129,868


Return to How do I....?

Who is online

Users browsing this forum: anty21ro, blackhornet, brunopalermo, jorgmaquoi, Rable, unicornspitfire and 7 guests