Open DragonMoffon opened 2 years ago
To my understanding, this would also be useful for caching loaded or pre-generated textures on disk. Providing functionality around that would be very helpful for projects like Brett's or the ambitious terraria clone a user was discussing on discord.
One challenge is: If you need the hit boxes for these textures that information will be lost.
I'm pretty sure this is done now, I remember @einarf showing it working but I'm not sure exactly if it was fully added in or not.
@einarf, do you have an update on this? I know you've been doing a lot of work on atlases, so if there are any other relevant issues, maybe link this in?
There is a load/save_atlas
in texture_atlas/helers.py
that is currently not exposed. It's a very experimental feature. There's also a script in experimental using it. There are probably many issues, but it's a start.
This code needs updating. I commented it out due to the pressure to get 3.0 out. It can be enabled and tweaked later.
Save and Load Texture Atlas.
Offer a way to save a generated Texture atlas or part of one and have it be loadable later.
What should be added/changed?
A TextureAtlas.save() and TextureAtlas.load().
What would it help with?
Exporting games, and run speed since no texture writing needs to be done at run time.
A bonus benefit is sprites that are only ever on the GPU and their textures never need to be loaded.
Could be two parts. A png file and a Json file that could look like