ForgeableSum Posted October 28, 2016 Share Posted October 28, 2016 Is there a way to get a copy of frame data in the format it was originally in before it went through the animation parser? Suppose I want to add a texture atlas to the cache that shares the same frame data as another asset. I can't use game.cache.addTextureAtlas because the frameData it expects (retrieved via game.cache.getFrameData) is in the original hash format, not the Phaser-version (i.e. what's output from Phaser.AnimationParser). Link to comment Share on other sites More sharing options...
samme Posted October 28, 2016 Share Posted October 28, 2016 I think this was posted before but I can't find it. Consensus was Phaser doesn't save the original data so you should instead load it with load.json, store a copy, then call load.atlasJSONHash as game.load.atlasJSONHash(key, textureURL, null, atlasData); Link to comment Share on other sites More sharing options...
ForgeableSum Posted October 28, 2016 Author Share Posted October 28, 2016 I already have my code working by using that method, samme, but my intention is to redo it the right way so the browser is sending fewer resource requests, using less bandwidth and ultimately load everything faster :). Link to comment Share on other sites More sharing options...
ForgeableSum Posted October 28, 2016 Author Share Posted October 28, 2016 I wonder if there is a way to add it to the cache like a normal image, e.g. game.cache.addImage, then give it the animation frames another way (instead of via loader). in other words, bypass the animation parser and use a direct copy of all the frame data the other sprite has. I wonder if setting setting sprite.animations to reference the animations of the other sprite will work? Link to comment Share on other sites More sharing options...
Recommended Posts