epa_neto Posted January 27, 2015 Share Posted January 27, 2015 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 Quote Link to comment Share on other sites More sharing options...
xerver Posted January 27, 2015 Share Posted January 27, 2015 This is the code used by the pixi json loader to load a spritesheet: https://github.com/GoodBoyDigital/pixi.js/blob/master/src/pixi/loaders/JsonLoader.js#L128-L161 In v3 this is easier and clearer. Quote Link to comment Share on other sites More sharing options...
epa_neto Posted January 28, 2015 Author Share Posted January 28, 2015 Thanks for the tip Quote Link to comment Share on other sites More sharing options...
epa_neto Posted January 29, 2015 Author Share Posted January 29, 2015 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.