add storyboard.preEnterScene so screen can be updated before transition occurs

Right now, enterScene is called AFTER a transition and the scene is fully visible on the display. however, this is often too late, and what we really need is the scene to be updated before the transition occurs.

For example, lets say you have a Scene that displays some items you can unlock. If you click on a locked item, it transitions to a buy scene where you can purchase the item. This buy scene needs to update the cost, description, image, etc. before it slides onto the screen. Then, after you make the purchase, you go back to the original scene, but you still see the item locked until the screen slides into place when suddenly it pops to unlocked.

I’ve been able to do this myself by doing something like:

local s = storyboard.getScene("buy")
if s and s.preEnterScene then
 s:preEnterScene()
end
storyboard.gotoScene("buy")

but it would be much better if this was handled by the storyboard API instead of forcing me to do it everywhere
[import]uid: 122310 topic_id: 23255 reply_id: 323255[/import]

Why are you not doing the things that need done before enterScene in createScene? If its dynamic and changes with each access, just purge the scene before you call it to force createScene to get called. [import]uid: 19626 topic_id: 23255 reply_id: 93079[/import]

I am doing the proper setup for createScene, and leaving the scene in memory (not using purgeScene) so that i don’t have to keep reloading the same assets over and over again. I think the API should still have a call before a transition starts so that the user isn’t forced to use purgeScene to unload it (thats why there is EnterScene and CreateScene in the first place) [import]uid: 122310 topic_id: 23255 reply_id: 93082[/import]

My request might work for you too.

A new function to loadScene which will create the scene but not goto it. That way you can purge your scene (save memory) and then have the power and control to load it again when YOU choose. [import]uid: 126708 topic_id: 23255 reply_id: 94412[/import]