Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

return to scene ?

  • #1, by magiclight 8 years ago Zitieren
    Lets say I can enter a scene from different places and I would like to return back to the same scene as I came from, is there anyway to do that ?

  • #2, by afrlme 8 years ago Zitieren
    You mean the previous scene you were on, or the current scene that you are already on?
  • #3, by magiclight 8 years ago Zitieren
    The previous scene, say I make some kind of settings scene the user can goto with a key press or something, after finished there I want to return to the scene where the user was before that.

  • #4, by afrlme 8 years ago Zitieren
    If the playable character was on the previous scene then you can use the "change to scene of character" action part - alternatively, you could store the current scene into a Lua variable before changing to the menu scene, then use that variable to go back to the previous scene.

    For example...

    execute a script >
    prev_scene = game.CurrentScene
    show scene/menu "menu"

    Now to go back to the previous scene when done you can use the execute a script action part & just inverse the script you wrote above, like so...
    game.CurrentScene = prev_scene

    It should take you back to the scene you stored in the prev_scene Lua variable you created.