我在使用Lua编程语言显示数组元素时出现问题.基本上,我创建了一个包含3个元素的数组,我试图在电晕sdk模拟器上的for循环中显示其内容.如果我显示各个数组元素(没有循环),它们会显示正常; 一旦我将它们放入for循环中,屏幕上就不再显示任何内容了
这是我的代码:
myText = {"hello", "world", "there"}
for i = 1, myText do
local myText = display.newText( myText[i], 0, 0, native.systemFont, 35 )
end
Run Code Online (Sandbox Code Playgroud)