Jump to content

Preload heavy file from localstorage or async process in preload


Alphapage
 Share

Recommended Posts

Hello,

 

As far as I think, phaser is loading asynchronously images in preload using this.game.load and caches images in memory, then continue with create().

 

If so, how can I tell phaser preload to wait for the async function to terminate when I run an async process in preload ?

Wouldn't it be nice to have a this.game.load.fromLocalStorage which returns an object for heavy files located in local storage and be able to get the progression ?

 

Thanks in advance for your help or your opinion.

Link to comment
Share on other sites

I think typically this is what manifest files are for, but yes this can be done not with preload but with states - if you have a boot state, you can use that to call forth your stored assets and do your own management of their progress and so on. When you've detected that they're done, you can just advance the state to the next one (menu or whatever) and if they're stored in the cache, they'll be accessible anywhere else in your game.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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