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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.