How do I switch between layouts?

0 favourites
  • 3 posts
  • I have a setting button in the game. When clicked I want to display a menu with multiple buttons.

    1. I dont know if the new option screen should be a layout or a sprite.

    2. When the option layout appears, does everything keeps running of the game layout? How to pause it?

    3. I am using the GO TO LAYOUT to switch between the layout, but this causes the on start layout to run, causing the game ton restart. What is the correct way to switch between the screens of your game?

    Thank you.

  • Wow, well here we go:

    1. You can use the same layout but the code will need managing better so you don't end up with crazy unmanageable event sheets, I advise you use a new layout if its a small project.

    2. The the new layout loads, the old layout will stop and destroy all objects. If you want it to not be destroyed, all the items inside it must be "global" (see object properties). If you want their code to still run, their code must be in a separate event sheet which is also loaded into the new layout.

    3. This is the correct way. If you want the game state to persist there are a lot of options, try looking at the "Save" actions and the "Load" actions also the "Global" setting. A lot of solutions here.

    Edit: As the below poster recommends Persist behaviour below I agree is better solution. Ignore statement 3.

    Hope this helps, let me know if you have any questions.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1. Screens are displayed into layouts, so you can use a layout to display one o more "screens", or use different layouts for different screens. It depends your design. In example, a layout sheet can create and destroy objects and/or show different menus on different cases.

    2. Game is paused on windows focusout event but you can handle the pause events by yourself. Please search in forums, it's plenty of info about that.

    3. A layout starts each time it's invoked, maybe you want a persistent layout, check then the Persist behavior.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)