How do I reload last layout

  • Hello,

    Does anyone have some tips for me on how to reopen last layout ... how to go back and forth amongst layouts without of need to do entire reloading and executing of layouts allover again?

    thanx!!!

  • bump!

  • I'm not sure what you mean, but wouldn't creating a global variable and setting it to the name of the layout before changing layouts work?

    so

    on button pushed

    • system set variable Lastlayout = layoutname
    • goto layout - (whatever layout you'd like to go to)

    on button "back to last layout"

    • goto layout - LastLayout
  • Hello, LittleStain.

    It's not problem to go to the certain layout... it's problem to not need to reexecute entire layout but to open it as it was on the moment i closed it and switched to other one.

    So that it preserves all executed states.

    BR

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You might want to look into the persist behaviour..

    https://www.scirra.com/manual/161/persist

  • well i did add that behaviour to desired objects but it shows no effect...

  • Without seeing your capx I can't be sure of why it doesn't work.

    The persist behaviour should make sure the objects remember their previous state.

    I'll try one guess, but am convinced it won't be right..

    Could it be you are resetting the objects through events or creating new ones with the original stats?

  • You need, when quitting the layout, to somehow keep in memory the state/position and any relevant informations for the objects in the current layout.

    And you need, on start of layout to check if this is the first execution of the layout or if the layout has already been executed, in which case you do apply the saved informations to the current "scene".

    The persist behavior can indeed help with that, be sure to consult its manual article to know exactly how to apply it.

    Otherwise, to manually save data, you can use data structures like arrays to keep in memory the several informations.

    To know what informations to save, this completely depends on your project and what you are trying to achieve, which is, as LittleStain explain, unknown to us because of a lack of capx or even clear/detailed explanations.

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