Imagesheet Edge Bleed During Animation

I’m working on a game where I stitch together sprites from an ImageSheet (generated by TexturePacker).

 

It’s looks/works fine on the iPhone simulator, however when I switch to the iPad or any of the android simulators, I’m seeing a 1px flashing border around the images as they move from right to left. See the attached image.

 

Any ideas what I am doing wrong?

Hi @brandontreb,

What is your screen size in “config.lua”? And what is the overall size of your pieces that you’re stitching together, in exact pixel dimensions? This could be an odd-sized pixel positioning issue…

 

Are you using dynamic image selection? Do you have all of your 2x or 4x images in place properly?

 

Brent

Hey Brent, Thanks for the reply. My sheet is 256x256 and all sprites are 64x64. I’m using dynamic sizing and have an @2x size (512x512) for retina. Ahh config is only for iPhone resolution (480x320). But it works fine on iPhone 4 and 5. I figured it would just letter box on everything else. Could this be my issue?

Hi Brandon,

What is your config.lua “scale” setting? Letterbox or something else?

Scale is “letterBox”.

 

Just to add some context:

 

Here is how Im loading the sheet:

 

local sheetInfo = require("images.alpha\_racers") local spriteSheet = graphics.newImageSheet( "images/alpha\_racers.png", sheetInfo:getSheet() ) local mountains = display.newSprite( spriteSheet, {frames={sheetInfo:getFrameIndex("mountains")}} ) backgroundGroup:insert(mountains) -- Do this for the other background tiles

 

 

and here is how Im moving things in the animate(event) method

 

for i=backgroundGroup.numChildren,1,-1 do local child = backgroundGroup[i] child:translate(-1,0) end

I think I solved it. I was using 0 for the starting point and changing that to 1 seemed to work.  Thanks for your help with this though.

Hi @brandontreb,

What is your screen size in “config.lua”? And what is the overall size of your pieces that you’re stitching together, in exact pixel dimensions? This could be an odd-sized pixel positioning issue…

 

Are you using dynamic image selection? Do you have all of your 2x or 4x images in place properly?

 

Brent

Hey Brent, Thanks for the reply. My sheet is 256x256 and all sprites are 64x64. I’m using dynamic sizing and have an @2x size (512x512) for retina. Ahh config is only for iPhone resolution (480x320). But it works fine on iPhone 4 and 5. I figured it would just letter box on everything else. Could this be my issue?

Hi Brandon,

What is your config.lua “scale” setting? Letterbox or something else?

Scale is “letterBox”.

 

Just to add some context:

 

Here is how Im loading the sheet:

 

local sheetInfo = require("images.alpha\_racers") local spriteSheet = graphics.newImageSheet( "images/alpha\_racers.png", sheetInfo:getSheet() ) local mountains = display.newSprite( spriteSheet, {frames={sheetInfo:getFrameIndex("mountains")}} ) backgroundGroup:insert(mountains) -- Do this for the other background tiles

 

 

and here is how Im moving things in the animate(event) method

 

for i=backgroundGroup.numChildren,1,-1 do local child = backgroundGroup[i] child:translate(-1,0) end

I think I solved it. I was using 0 for the starting point and changing that to 1 seemed to work.  Thanks for your help with this though.