when I import my sprites using the SpritePackedManager, they all are scaled to width = height = 1 world units (I think). This makes most of them look very odd, so it seems that I need to scale them manually. I wanted to do this by using my precalculated pixelsPerWorldUnit value (in this case, 32 pixels should be 1 world unit), so that a sprite with original width of 64 px would be scaled to width = 2.0 (2 world units = tiles in my game).
Unfortunately, I can’t seem to find any way to access the original properties of the source images, despite it being present in the JSON I generated via TexturePacker in the form of the grid’s boundaries. I haven’t seen anything at all in the Sprite APIs that allows scaling other than using world coordinates directly, which is useless if I can’t fathom how big the sprite should be in the first place. The HOWTO/Tutorials also ignore this crucial step of rendering sprites correctly, simply stating that I can set the dimensions with the width/height/size properties. Am I missing something basic here? This seems like a no-brainer otherwise.
Perhaps someone can point me in the right direction? Cheers!
Edit: I found this in the SpritePackedManager object (dumped via JS): https://i.imgur.com/vQIcYWK.png
There’s a private property _celldata containing a sourceSize.w and sourceSize.h property for each frame object, as well as the spriteSourceSize containing the same info?
This is exactly the value I need, except I’m not sure about which to use, and if there’s a proper API. Relying on the internal fields seems like a terrible idea. Ideally, I’d just want to use sprite.sourceSize.w or something similarly straight-forward.
Also, I can’t fathom what the difference is between the two. Does it matter? spriceSourceSize appears to also have some x, y fields that are always zero in my case?