Layout Navigation dilemma

0 favourites
  • 6 posts
  • Hi,

    here's my situation:

    I have two layouts A & B,

    A being the default one.

    Layout A has event that will trigger 'Go to layout B' and

    layout B has event that will trigger 'Go to layout A'.

    And when I get back to layout A from B, layout A is not in its initial state. All I wish is that Layout A has been reset as if it was the first time am on it. I have tried 'Restart layout' and 'Reset Global variables' but none seems to work (or I don't know the right place to use them).

    and it definitely doesn't run through the 'on start of layout' condition when I get back to layout A..

    All I wish is a complete reset of Layout A when I get back to it from Layout B..

    Anybody?.. Please help.. it seems trivial but am stuck on it..

  • You must use the behavior "persist" on objects so they'll stay in the same place when you switch layouts.

    Edit- Oops, read it wrong. You actually want layout A to be reseted? That's weird, it should be when you start it again.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Strange, I remember using "Restart Layout" before and it did trigger the "on start of layout". I recall creating an infinite loop this way.

  • Yep.. that's the dilemma..

    when you get back to layout A from layout B, things have changed.. the 'on start of layout' triggers only once (at the very first opening of a layout) and not every time you get back to it.. But am still gonna try the 'persist' thingy Andre..

    Thanks dude, much appreciated.. will let you know what happens..

    Anyone else came across this?

  • Yo Robsta,

    the restart layout action always triggers the on start of layout condition.. but.. provided you stayed on the same layout..

    but when you coming from another layout..

    I can't seem to find a sweet spot to trigger the restart layout action in my event sheet..

    Have you tried anything like that before?

    Yuv

  • I'm leaning that this is coding problem. Without knowing more about your code we can't determine the problem.

    There is of course the persist behaviour that you don't want to use, but are your objects set to global?. How about creating a simple capx that we can take a look at.

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