Hello Guest

Author Topic: Renaming atlas0.png  (Read 3017 times)

David Kalina

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 26
    • View Profile
Renaming atlas0.png
« on: October 22, 2013, 01:08:26 am »
It would be helpful for us if every generated texture atlas didn't have the exact same filename (so, for example, we could more easily identify loaded textures in a crowded scene and clean up dependencies). 

So, in tk2dSpriteCollectionBuilder.cs, I'm changing the line that sets the name to this:

Code: [Select]
string texturePath = gen.atlasTextures[atlasIndex]?AssetDatabase.GetAssetPath(gen.atlasTextures[atlasIndex]):(dataDirName + gen.name + "_atlas" + atlasIndex + ".png");
Which turns an atlas0.png into my_collection_atlas0.png (where my_collection is the full name of the sprite collection)

I basically just wanted to sanity check and make sure this was an OK thing to do and wouldn't cause unexpected problems!  Seems safe but I don't mess with the tk2d internals any more than I have to.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Renaming atlas0.png
« Reply #1 on: October 22, 2013, 10:02:46 am »
That is perfectly fine, it doesn't use filenames for anything.

Interestingly, it used to be named based on the sprite collection name, but... things started getting messy when the sprite collection was renamed. Even worse when things were renamed, and then atlas spanning turned on - you'd have 2 atlases with different names. We thought the saner solution was to simply name it atlasX.