Hello guys and girls,
I have a strange error. I am creating a sprite animation from a sprite-sheet with 6 frames. Here’s the code
[lua] local options =
{
– The params below are required
width = 235,
height = 386,
numFrames = 6,
– The params below are optional; used for dynamic resolution support
sheetContentWidth = 1410, – width of original 1x size of entire sheet
sheetContentHeight = 386 – height of original 1x size of entire sheet
}
sheet1 = graphics.newImageSheet(“Pictures/Balcony/plantSprite.png”, options)
local sequenceData = {
name=“grow”,
frames = {6, 5, 4, 3, 2, 1},
time = 3000, – Optional. In ms. If not supplied, then sprite is frame-based.
loopCount = 1, – Optional. Default is 0 (loop indefinitely)
loopDirection = “forward” – Optional. Values include: “forward”,“bounce”
}
character = display.newSprite(sheet1, sequenceData)
[/lua]
Now, when I play the sequence it’s skipping 2 frames 2:nd and 5:th, I think. But if I change the code to
[lua]
local sequenceData = {
name=“grow”,
frames = {6, 5, 4, 3, 2, 1, 0},
time = 3000, – Optional. In ms. If not supplied, then sprite is frame-based.
loopCount = 1, – Optional. Default is 0 (loop indefinitely)
loopDirection = “forward” – Optional. Values include: “forward”,“bounce”
}
[/lua]
then it works but I receive a warning: “WARNING: Sequence (grow) has an invalid index (0) that falls outside the range of valid image sheet frame indices: 1 <= index <= 6.”
Any idea what I am doing wrong?
BTW, I am on OS X 10.8.4 and Corona Version 2013.1154 (2013.6.29).
Thanks in advance