Gotcha, thanks. Why would you want to do this? It's unusual to care what the image names are.
The texture packer does not support this. Atlas page images are named after the atlas file with a numeric suffix.
Should it be supported? When packing a subfolder to its own atlas page, we could name the page after the folder. You could still end up with a numeric suffix if there are more images than fit on one page. However, we'd need to have a plan on how the combine subdirectories
setting works with this naming. A subfolder can have a pack.json
file that enables combine subdirectories
for that subfolder, in which case all images for the subfolders of the subfolder would be named after the rootmost folder that doesn't have combine subdirectories
enabled. That may work if there are no other complexities, but before we can add such a feature I need to understand why you would care what the atlas image file names are.
How to workaround it? At runtime if you want to get the atlas image that has a particular region, get the region (eg from the atlas) and the get the reference to the image. Eg, if you want to do something with the texture that has weapons, get the sword
AtlasRegion, then look at its AtlasPage which has a rendererObject that is the texture for your game toolkit. The texture likely can tell you what file it came from. If you have an attachment, not a region, then look at the mesh or region attachment's rendererObject
, which is an AtlasRegion for most game toolkits.
Another workaround is to edit the atlas file with a text editor to change the names for each section. Then you can rename the files in the same way.