Get previous Scene

Hi.
someone could explain how it works getPrevScene function ().
I want to go from one scene to the previous one was charged.

thanks [import]uid: 110846 topic_id: 26285 reply_id: 326285[/import]

storyboard.getPrevious() returns the scene name of the previous scene you were on.

local before = storyboard.getPrevious() -- stores the previous scene name if before then -- if there was a previous scene storyboard.gotoScene(before) -- goto it end

[import]uid: 41884 topic_id: 26285 reply_id: 106631[/import]

thanks,
but wanted to use director class. Is there something similar in director class?

thanks richard9 [import]uid: 110846 topic_id: 26285 reply_id: 106759[/import]

Blah. My mistake. I was wondering why you wrote the command so differently! :wink:

A quick look at the Director 1.4 source indicates getPrev works not that differently, though.

prevScene = moduleName -- director.lua:736

It’s been forever since I actually tried director but presumably you could substitute “target” in director’s goto function with director.getPrevScene()? [import]uid: 41884 topic_id: 26285 reply_id: 106784[/import]