I have an image sheet with four frames that I use for creating sprites. Each frame is 64px in both directions, making the full sheet 256 x 64 px. The sheet looks like this:
Sometimes when I use this for a sprite it seems like the frames are positioned slightly off within the sheet, so it looks like one frame is “stealing” one pixel column from another frame. Like this, where one pixel from the first frame floats over into the second frame:
The weird thing is that it doesn’t happen on all sprites, and only for some device resolutions. So I’m figuring it could possibly have something to do with how Corona handles scaling of image sheets to match the current resolution?
I’ve seen this problem several times before with my image sheets and have worked around it by leaving a 1px transparent margin around all my image frames. Anybody else noticed this behavior? Should I do something differently when creating and configuring my image sheets?
The Lua config for my image sheet looks like this:
local options = { frames = { { x=0, y=0, width=64, height=64, }, { x=64, y=0, width=64, height=64, }, { x=128, y=0, width=64, height=64, }, { x=192, y=0, width=64, height=64, } }, sheetContentWidth = 256, sheetContentHeight = 64 }