Sign in to follow this  
phamedev

Can I show the load progress of sprite Atlas?

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`.

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.