How do I make a thing happen if I load a certain layout?

Get help using Construct 2

Post » Fri May 08, 2015 11:43 pm

So I was making my game and I decided I should make a menu for when you press Esc. So I was able to set it up so that if you press Esc you go to the menu layout. But then I realized that if you were in a certain layout and you went to the menu, then you wouldn't be able to go back to the certain layout. I looked through the "IF" statements in the event sheet and I couldn't find one for this problem. Is there a way to make it go from the menu back to the layout you were in before?
Posts: 4
Reputation: 208

Post » Sat May 09, 2015 12:31 am

Do you have to save the game and go back to the exact point on the layout or just go back to the layout?

Usually you have the menu as a hidden layer on the layout and when you press the esc key for example the game pauses and the hidden menu layer is then unhidden. And when you press esc again the layer disappears and the game unpauses.

But lets say that you have made a own layout for the level and want to go back. Then make a variable and name it "Layout" that stores the name of the layout. So when you press the esc key > set variable to "layout name" and go to menu layout. Then when you want to go back from the menu and you press the esc key > go to layout by name "Layout"

You will then come back to the last layout you were on before you went to the menu. Hard to explain but hope you understand. Don't forget to set the variable as a text variable.

But I would recommend having the menu on a hidden layer instead. Or are you talking about the main menu?

You can look at this CapX ... ayout.capx
Last edited by Anonnymitet on Sat May 09, 2015 12:57 am, edited 2 times in total.
Posts: 814
Reputation: 14,544

Post » Sat May 09, 2015 12:41 am

Posts: 1,013
Reputation: 9,165

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 63 guests