corona - Lua - nil value -
i following error message corona sdk : attempt call field "imagesheet" (a nil value) stack traceback. can point out mistake?
local ispar = { width = 2541, height = 264, numframes = 7 } local imagesheet = graphics.imagesheet("apus.png, ispar") local apussequencedata = { {name = "fly", frames {1,2,3,4,5,6,7}, time = 800, loopcount = 0} } local apus = display.newsrpite(imagesheet, apussequencedata) apus.x = display.contentwidth/2 apus.y = display.contentheight/2 apus:play()
you got function name wrong, supposed graphics.newimagesheet. misplaced quotation marks when calling it. , afterwards misspelt newsprite
this code should work:
local ispar = { width = 2541, height = 264, numframes = 7 } local imagesheet = graphics.newimagesheet("apus.png", ispar) local apussequencedata = {{name = "fly", frames = {1,2,3,4,5,6,7}, time = 800, loopcount = 0}} local apus = display.newsprite(imagesheet, apussequencedata) apus.x = display.contentwidth/2 apus.y = display.contentheight/2 apus:play()
Comments
Post a Comment