Sprite Sheet question

Does anyone know whether a Sprite Sheet that’s 12 frames on a single row is interchangeable with a Sprite Sheet with 12 frames arranged 4 across and 3 down (apart from the obviously different x,y and sheet dimension parameters)?

In other words, is there any parameter (a row parameter?) that needs to be specified to designate that an animation sequence extends across multiple rows? Or will Corona simply select the specified frames regardless of sheet layout, given the right width, height, numFrames, sheetContentWidth, and sheetContentHeight parameters?

Also, do blank frames in a Sprite Sheet cause problems?

Thanks.

Hi @Dotnaught,

Since sprites use (pull) their info from image sheets, the sequencing can be the same, as long as you reconfigure the image sheet (and its data) properly to reflect the changes in orientation/layout. In other words, you can arrange the frames any way you wish on the sheet, as long as you tell Corona where the frames are oriented.

Also, blank frames should not cause any issues.

Brent

So rather than doing this, as you might with a straight row:

local options = { { width = 73, height = 74, numFrames = 4, sheetContentWidth = 294, sheetContentHeight = 74 },

you’d use the frames parameter thus to specify each center rather than relying on x,y values that get computed automatically?

local options = { frames = { --frame 1 { x = 0, y = 0, width = 235, height = 276 }, --frame 2 { x = 235, y = 0, width = 277, height = 276 } } }

That should work too, but what I was hinting is that you can arrange the sheets however you want, and Corona will read the frames left-to-right, row after row. As long as you arrange the sheets properly and then update the overall sheet width and height, it should work the same.

For example, if you have 4 equal-sized frames, all of the following sheet configurations would work:

XXXX   XX XX   X X X X

Hi @Dotnaught,

Since sprites use (pull) their info from image sheets, the sequencing can be the same, as long as you reconfigure the image sheet (and its data) properly to reflect the changes in orientation/layout. In other words, you can arrange the frames any way you wish on the sheet, as long as you tell Corona where the frames are oriented.

Also, blank frames should not cause any issues.

Brent

So rather than doing this, as you might with a straight row:

local options = { { width = 73, height = 74, numFrames = 4, sheetContentWidth = 294, sheetContentHeight = 74 },

you’d use the frames parameter thus to specify each center rather than relying on x,y values that get computed automatically?

local options = { frames = { --frame 1 { x = 0, y = 0, width = 235, height = 276 }, --frame 2 { x = 235, y = 0, width = 277, height = 276 } } }

That should work too, but what I was hinting is that you can arrange the sheets however you want, and Corona will read the frames left-to-right, row after row. As long as you arrange the sheets properly and then update the overall sheet width and height, it should work the same.

For example, if you have 4 equal-sized frames, all of the following sheet configurations would work:

XXXX   XX XX   X X X X