I’m currently working on a project which uses an animated spaceship with flickering lights. I’m setting the animation as follows:
local shipSheet = graphics.newImageSheet("scene/graphics/ship-front.png", { width = 96, height = 22, numFrames = 2, sheetContentWidth = 96, sheetContentHeight = 44 } ); shipFront = display.newSprite(playerGroup, shipSheet, { name = "flash", frames = {1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, time = 1600, loopCount = 0, loopDirection = "forward" } ); shipFront.x, shipFront.y = shipBack.x, shipBack.y + 18; shipFront:play();
However, though the animation plays it doesn’t seem to be working correctly. I’ve attached two images below that show how the first frame draws a little bit of the second frame at the bottom and the second frame ends up losing a row of pixels at the top. It’s very subtle but it’s significant enough that I don’t want it to look like that, especially when I end up adding the vector graphics instead of the sketchy raster ones. The spritesheet is 96x44px.
Thanks in advance!
EDIT: Just to add I’ve also tried using what’s explained in “Complex Options” here: https://docs.coronalabs.com/guide/media/imageSheets/index.html but it hasn’t helped