fariazz Posted May 16, 2018 Share Posted May 16, 2018 I'm looking at creating a loading screen, followed by a home screen, and the game screen. For that, I was thinking of using a Scene for each. My question is, if I do the preloading of the assets in the first scene (loading screen), and then move to the home scene, will the assets be available and cached between scenes? or does each scene need to load it's own assets? Link to comment Share on other sites More sharing options...
fariazz Posted May 16, 2018 Author Share Posted May 16, 2018 Never mind! Found the answer in the Phaser newsletter: Quote The Cache. When files are loaded by a Scene they are placed into a global cache. So if Scene A loads an XML file, that XML data can be retrieved by any Scene as the cache is global. Link to comment Share on other sites More sharing options...
snowbillr Posted May 16, 2018 Share Posted May 16, 2018 Kind of a convoluted example of this can be found here https://labs.phaser.io/edit.html?src=src\scenes\change scene from create es6.js. It loads some assets in SceneA and then creates them in SceneD. Link to comment Share on other sites More sharing options...
fariazz Posted May 17, 2018 Author Share Posted May 17, 2018 All the assets are cached between scenes. If you load an asset in Scene A, you can then create say sprites from it in Scene B. Link to comment Share on other sites More sharing options...
Recommended Posts