In the past I was using the old API and Zwoptex to handle my sprites, but I’m making the change over to the new API while still using Zwoptex and the old data files, and I’m running into problems.
Here is what my code looks like with an urchin.lua file in the main directory and the sprite sheet in /images folder, both made with Zwoptex.
local oldStyleSpriteSheetData = require(“urchin”).getSpriteSheetData()
local urchinOptions =
{
spriteSheetFrames = oldStyleSpriteSheetData.frames
}
local urchinSheet = graphics.newImageSheet( “images/urchin.png”, urchinOptions )
local sequenceData = {
name=“cycle”,
start=1,
count=4,
time=100,
loopCount = 0
loopDirection = “bounce”
}
local urchin = display.newSprite( urchinSheet, sequenceData )
urchinOne.x = 320
urchinOne.y = 525
localGroup:insert(urchinOne)
And here is the error message I am getting…
Runtime error
/Users/anthonygrajirena/Desktop/wm/director.lua:440: ERROR: table expected. If this is a function call, you might have used ‘.’ instead of ‘:’
stack traceback:
[C]: ?
[C]: in function ‘insert’
/Users/anthonygrajirena/Desktop/wm/director.lua:440: in function ‘_listener’
?: in function <?:531>
?: in function <?:226>
Any help would be great, thanks. [import]uid: 10356 topic_id: 30903 reply_id: 330903[/import]