Sign in to follow this  
BobBob

load progress incorrect for sprite sheets in Phaser 3

Recommended Posts

Has anyone encountered a problem with the load progress reporting incorrectly when loading sprite sheets?  I'm loading a large sprite sheet and loading goes from .5,.33,.66, to 1.00 immediately and loads these numbers every time.  The game does eventually load fine, but way after load progress reports 100%.  Here's the code:

this.load.multiatlas('sprite_sheet1', 'sprite_sheets/sprite_sheet1.json', 'sprite_sheets');

this.load.on('progress', function (value) {
          console.log(value);
      });

I'm using Phaser 3.  Anyone see any problems with the way I'm doing this?

Share this post


Link to post
Share on other sites

Yes.  Also, the reported loading values are always the same, in this exact order with these exact values .5,.33,.66, to 1.00 (happens pretty much instantaneously).  In other words "real" loading progress is not reported.  

I'm thinking this has something to do with it reporting loading for only the .json file(tiny file, loads very fast) but not reporting on loading for the associated .png sprite sheet (larger file, hence the delay).  Just an idea, but I don't know how I could remedy that.

Client is requiring "real" loading progress to be reported.

Share this post


Link to post
Share on other sites

`progress` is per file, not per byte, so those values aren't unusual. The second-level assets should also get queued, and it looks like `progress` is showing that. You can probably verify by using the loader's `filecomplete` event.

It's possible something else is causing a delay even after file loading is finished. You could try the browser's Timeline tool for that. 

https://github.com/samme/phaser3-faq/wiki#i-need-per-file-loading-progress

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.