I am returning to an old project that was using SpriteGrabber and am updating to the use new image sheet system in Corona. I am using the “graphicsCompatibility = 1” mode.
I have read every article & API I can find and feel I have a grasp of the “gotchas” of image sheets and trimming. However, I am still seeing animations become incredibly misaligned from frame to frame.
I have checked and double checked the image sheet TexturePacker outputs, along with the data. From what I see, the sourceX, sourceX, sourceWidth, and sourceHeight are right. As well as the sheetContentWidth/Height. Here is what I am seeing.
Example data:
{ -- boss3\_base\_04 x=623, y=2, width=169, height=260, sourceX = 137, sourceY = 65, sourceWidth = 477, sourceHeight = 384 },
Here is the image in game. (I wish Corona would go back to the back to old pause mode where it didn’t make everything dark!)
Here is what the trim should be according to the sourceX/Y/Height/Width. I outlined the above data in a blue box
Here is the final image sheet, I outlined the above data in a blue box
Sorry for the extra space. I wanted to include the entire sprite sheet.
Its like it’s offsetting the sprite crop? And it changes frame to frame. If I did all this for another frame, it would be wrong (and differently wrong) in the game, but still look right according to the data.
I am positive that:
-
Every source image is aligned correctly with one another
-
Every source image is the same size (477x384)
* EDIT - more information *
-
Just running low-res (non @2x) images seems to work fine, it’s the @2x versions only that do this? I haven’t tested this extensively but it seems that way.
-
This has the same behavior under graphics 2.0
Any ideas what I am doing wrong?
Thanks.