I was working on a new app yesterday, and noticed that reload scene was not calling scene:enterScene() unless I used purgeScene() in the scene:exitScene() function.
I presumed that I had simply forgotten how reloadscene works (I had remembered that it doesn’t call createScene and thought maybe it doesn’t call either function). So I used purge scene, and for that app it was actually more useful to use purge scene anyway, so that was fine.
I have now gone back to another app I have been working on, which has a restart level button. This was implemented a good few weeks ago, and was working fine. Someone tested the app for us last night, and realised that the restart button clears the current scene (i.e. it calls the exitScene function which is where I remove all of the objects) but it doesn’t call the enterScene function (which is where I add all of the objects). I know this was definitely working before, and the docs : http://docs.coronalabs.com/api/library/storyboard/reloadScene.html
say that the following functions will be called by reload scene:
*willExitScene
*exitScene
*createScene (only if scene’s view display group does not exist)
*willEnterScene
*enterScene
I have put a print(“I have entered the scene”) at the beginning of the enterscene function and it never prints if I use reloadScene.
We have updated to the latest build (942), but this morning we were using build 936 or 937 and the same problem was happening.
Has anyone else noticed this, or have I missed a change somewhere along the line?
[import]uid: 84115 topic_id: 32559 reply_id: 332559[/import]
[import]uid: 52491 topic_id: 32559 reply_id: 129712[/import]