Pharan

https://github.com/libgdx/libgdx/commit ... 31ef2f34eb

So the libGDX atlas format now stores page sizes on the .atlas file?

(I hope this allows Spine-Unity to tell if the texture is being scaled on import and log some stuff in the console, or correct the import settings if necessary. Or maybe even scale region values to match the import scaling + log that this is happening.)

EDIT:
You know what, I think Spine-Unity can already do this. I... MIGHT do a PR. :rofl:
Just for the console logging case.

EDIT2:
So, it's not cleanly possible. Getting the original file's dimensions is some kind of hidden method that we can't get to without some hackish stuff. *shakes fist at UT*
The page size thing will definitely help (and eliminate the need to get the original image size, at least for this case).
Avatar
Pharan
  • Postovi: 5366

Nate

Yeah, this way you can defer loading the texture until some later time and all the UVs for the regions in the atlas will be correct. You'll just need to set the texture on the atlas page when it is ready.

I hadn't thought about using it to detect if Unity is scaling and ruining the texture. Too bad that didn't work out. :(
Avatar
Nate

Nate
  • Postovi: 11846

Pharan

Nah, it only doesn't work without the new additions to the libGDX atlas format.

We can already get the TextureImporter object's maxTextureSize property.
So with this new addition to libGDX atlases, we can check if textureImporter.maxTextureSize < width or height stored in the atlas.

And then provide the appropriate feedback and/or convenience.
Avatar
Pharan
  • Postovi: 5366


Natrag na Off-topic