我从Corona SDK收到以下错误消息:尝试调用字段“ImageSheet”(零值)堆栈回溯。有人可以指出错误吗?
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()
答案 0 :(得分:0)
你的函数名称错误,它应该是graphics.newImageSheet。你在调用引号时也错了引号。然后你拼错了newSprite
此代码应该有效:
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()