turnA Posted July 27, 2018 Share Posted July 27, 2018 Hi there, Can I load several different assets at a different moment inside the same scene? I ask since I seem can't trigger preload function again (which will load different asset every time) even if I visit a scene repeatedly. I'm using scene switch btw. Any help will be greatly appreciated. Thanks. Link to comment Share on other sites More sharing options...
fazz Posted July 27, 2018 Share Posted July 27, 2018 I believe you need to load the assets when the scene starts. You can create objects whenever you like, but the assets need to be loaded first. If you want to load the same scene with different assets, you could pass data to the scene when you start it, and use that data to define which assets to load. An example of passing data to a scene can be found here https://labs.phaser.io/edit.html?src=src\scenes\passing data to a scene.js turnA 1 Link to comment Share on other sites More sharing options...
Tom Atom Posted July 27, 2018 Share Posted July 27, 2018 Hi, you can load assets outside preload method. Look at this example: http://labs.phaser.io/edit.html?src=src\loader\loader%20events\start%20loader%20manually.js fazz and turnA 2 Link to comment Share on other sites More sharing options...
turnA Posted July 27, 2018 Author Share Posted July 27, 2018 32 minutes ago, Tom Atom said: Hi, you can load assets outside preload method. Look at this example: http://labs.phaser.io/edit.html?src=src\loader\loader%20events\start%20loader%20manually.js This is exactly what I mean! Thanks for the help! ^^ Link to comment Share on other sites More sharing options...
Recommended Posts