owen Posted August 20, 2014 Share Posted August 20, 2014 Hi I have dozens of sprite sheets and images that I'm preloading in my preload() function and it's starting to take a few seconds, so I need to tell the user it's preloading and how complete that is. At the moment I'm adding 1 to a counter of preloads after each loading of a spritesheet or image and then displaying the counter. But it doesn't seem to work; it just adds them all up instantaneously and carries on preloading. In other words the preload seems to continue happen in the background after I display the counter. And so it gets stuck at 100% and sits tehre for a few seconds while in reality things are still being loaded. What I need is a very simple example of a working preload() function which shows progress of the load (ideally adds 1 to a counter per item loaded). It does not have to be a progress bar, I would settle for a 'Loading file 1 of 10' text progress. (Though if a progress bar is easier that's fine). Is there a standard / accepted way of doing this? thanksOwen Link to comment Share on other sites More sharing options...
wayfinder Posted August 20, 2014 Share Posted August 20, 2014 http://examples.phaser.io/_site/view_full.html?d=loader&f=load+events.js&t=load%20events owen 1 Link to comment Share on other sites More sharing options...
owen Posted August 22, 2014 Author Share Posted August 22, 2014 http://examples.phaser.io/_site/view_full.html?d=loader&f=load+events.js&t=load%20events Thanks, I can use that. Link to comment Share on other sites More sharing options...
owen Posted September 2, 2014 Author Share Posted September 2, 2014 EDIT: I got it working thanks to the example although I had to tweak it a little for my purposes. Link to comment Share on other sites More sharing options...
Recommended Posts