我似乎在这里遇到了一些严重的问题 - 我正在尝试显示图像并将其转换,然后在底部有闪烁的文本。
function Splash()
local item = display.newImage("SplashImage.png")
item.x = display.contentWidth*0.5
item.y = display.contentHeight*0.5
item.alpha=0
transition.to(item, {time =1500, alpha=1, onComplete=Blink})
end
-- blinking text
function Blink()
text = display.newText("This is Blinking Text", 100, 100, "Arial", 22)
text.x = display.contentWidth/2
text.y = display.contentHeight/1.2
text.alpha=0
transition.to(text, {time =1500, alpha=1, onComplete=Blink2})
end
function Blink2()
if (text.alpha > 0) then [--THIS IS THE LINE THAT IS BROKEN APPARENTLY]
transition.to(text, {time=1500, alpha=0})
else
transition.to(text, {time=1500, alpha=1})
end
end
txt_blink = timer.performWithDelay(500, Blink2, 0)
代码中断并出现错误“尝试索引 upvalue 'text' (a nil value)”
我在这方面完全是菜鸟,所以要温柔!