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

0 favourites
  • 3 posts
  • 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?

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)