soylomass Posted April 7, 2017 Share Posted April 7, 2017 Hi, is it possible to load assets on the run, and show them on a sprite when they are loaded? I'm developing a team feature, where a team (and it's logo) may have been created after the game was loaded (therefore I can't load it's texture on preload). I've seen other canvas games which do that, for example Agar.io (http://agar.io/). You can check the chrome console, Network tab, filter by Img, and you'll see the images are loaded as a player using them appears on screen. This is all seamless. Is it possible to do with Phaser? Thanks in advance. Link to comment Share on other sites More sharing options...
mattstyles Posted April 7, 2017 Share Posted April 7, 2017 The standard loader can be used as many times as you want (I think), you'd just listen for the load events and start displaying the corresponding sprites when you hear it. The process is the same with any browser load, request the asset, listen for the onLoad/onComplete event, respond using the loaded asset, handle failures. soylomass 1 Link to comment Share on other sites More sharing options...
Tom Atom Posted April 8, 2017 Share Posted April 8, 2017 You can create separate loader instance which will be independent on loading when changing states. Some time ago I posted here: my solution for loading music in background after game started. If you adjust it, it ccan be used to load any type of asstes. Link to comment Share on other sites More sharing options...
Recommended Posts