Hello Guest

Author Topic: Resizing error when commiting a SpriteCollection  (Read 4385 times)

juanmanolo

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 1
    • View Profile
Resizing error when commiting a SpriteCollection
« on: April 12, 2013, 11:08:20 am »
Hello,

I'm using big textures and before to drop them to a SpriteCollection prefab I'm resizing them through the unity inspector. For example I set all of them to 256 Max Size.

Then I drop them to the SpriteCollection, and then I click "commit", then appears this message:

You have a texture which exceeds the atlas size. Consider putting it in a separate atlas, enabling dicing, or reducing the texture size


And I can see inside the SpriteCollection that all my textures are now bigger (W:1000) and in the Project folder also the textures had become bigger (Max Size 4096).

Why is this happening?

Thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Resizing error when commiting a SpriteCollection
« Reply #1 on: April 13, 2013, 02:10:46 pm »
tk2d by default resizes the textures to 4096 while processing the atlas. The reason for this is that Unity defaults to 1024 or something for textures, and there is no way to read the contents of the textures properly without changing the max texture size - tk2d pushes it to 4096, simply because otherwise there would be no way to know if the texture size is correct or not.

If you want to use this, then you can disable the line of code in tk2d that resizes the textures. Its in tk2dSpriteCollectionBuilder.ConfigureSpriteTextureImporter( ... )
the 2 lines with
importer.maxTextureSize

But keep in mind that you'll have to manually handle all of the above from this point on should you decide to go down this path.