Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | MEDBVLL |
I’m trying to generate an AtlasTexture
programatically given a collection of .png resources found in my project.
The idea behind it is to create a .json with the id and paths to these resources, then for each entry in it load the textures into an AtlasTexture, with the id being the position of the texture in the atlas.
The size of the atlas needs to also be dynamic, depending on the number of entries, so if we have 255 textures of 32px each, ceil( 255 / 2 ) * 32 = 4096px
width/height.
How would I do this?