Jump to content

Initialize sprite sheet from localStorage data


epa_neto
 Share

Recommended Posts

Hello all,

 

I'm building an update scheme for my game where the user downloads the new assets from the server.

Every bitmap and JSON files will be stored under @cocoonjs localStorage file for further use.

 

The thing is, I just can't find a way to initialize a sprite sheet on PIXI.js by passing the JSON and bitmap data instead of the JSON location.

 

Anyone knows an workaround to register a sprite sheet on PIXI.js at this scenario?

 

All the best,

Epa

Link to comment
Share on other sites

Just to let everyone know, the local storage is very limited when it comes to size, and having to convert base64 images on device it takes a lot of processing power. So I found a feature on cocoonjs that it's not documented yet, in case someone needs:

 

http://support.ludei.com/hc/en-us/articles/202892208-XHR-download-to-file-extension

 

There is now a save and load feature on the XMLHttpRequest inside cocoon. 

 

You can save the files to device, and send to PIXI the local url. 

 

All the best,

Epa

Link to comment
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...
 Share

  • Recently Browsing   0 members

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