Braxen Posted September 7, 2017 Share Posted September 7, 2017 I've made my own class that can "combine" multipack atlases and select images between them (frame names are very important), but the biggest hurdle still is that i need pivot/anchor points. I have them all in the texture atlas (JSON), created by my own tool. However, when i load this atlas, only hardcoded data is put into the frameData object, and i can't seem to hijack the JSON file being loaded either. I've thought about creating my own loader class, but with this framework workflow i just get confused. Is this something that's planned for future releases, or are pivot points obsolete now? Link to comment Share on other sites More sharing options...
samme Posted September 7, 2017 Share Posted September 7, 2017 The atlas object in the game cache should have the original JSON data somewhere. So you could look it up and the just assign anchor and pivot. Link to comment Share on other sites More sharing options...
Braxen Posted September 7, 2017 Author Share Posted September 7, 2017 2 hours ago, samme said: The atlas object in the game cache should have the original JSON data somewhere. So you could look it up and the just assign anchor and pivot. Oh I've looked. This is the function that discards it. I ended up hijacking it on game boot, it works - but a very duct-tape-esque solution. And i've hijacked the loadTexture and set frameName functions too, so it automatically sets the pivot point on load. Link to comment Share on other sites More sharing options...
samme Posted September 7, 2017 Share Posted September 7, 2017 Hm, you could use Loader#json followed by Cache#addTextureAtlas if you'd like a cleaner way to keep the extra data. Link to comment Share on other sites More sharing options...
Braxen Posted September 8, 2017 Author Share Posted September 8, 2017 9 hours ago, samme said: Hm, you could use Loader#json followed by Cache#addTextureAtlas if you'd like a cleaner way to keep the extra data. yeah, but then we're getting into the workflow, i'd rather not have a pile of functions for each loading call, i didn't find the callbacks that customisable. packs are doing a pretty good job so far though Link to comment Share on other sites More sharing options...
Recommended Posts