Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

More attributes in texture atlases?


Braxen
 Share

Recommended Posts

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

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

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

 Share

  • Recently Browsing   0 members

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