Jump to content

Can I show the load progress of sprite Atlas?


phamedev
 Share

Recommended Posts

As far as I know, this isn't really feasible because there's no way to know how big the file being downloaded is.  It's possible to get the `header` information from the request to get the total number of bytes downloaded already, and then compare that to some hard-coded value about the size of the value (or fetch the size of the file via some back-end request) but that seems fragile and too heavy-handed.

Most Phaser games show progress as a percent of total files downloaded (not great if you've got a big sprite atlas, or large music files, but it's something at least)

Here's my example of how I show progress of loaded files:

https://github.com/Cudabear/ldwrap/blob/master/src/state/LoadState.js

The important line is `this.load.setPreloadSprite`.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...