Im doing a game, so I have to put 9 objects in the screen. So I decided do this (Im using DIrector, this may be relevant):
tabela = {{"","",""},{"","",""},{"","",""}}
init\_btn = function ()
local button = display.newImage("image/botao.png")
for l = 1, 3 do
for c = 1, 3 do
tabela[l][c] = button
tabela[l][c].x = 100 \* c
tabela[l][c].y = 100 \* l
localGroup:insert (tabela[l][c])
print("tabela: l c:", l, c)
end
end
end
So, What im doing wrong? All 9 buttons appear in the exact same place. This “print” is here just to make sure I did not make anithing wrong in the for statement.
Ideas? I will put an event in each one after this, so I will change the image after a “tap” event.
Thanks! [import]uid: 9133 topic_id: 13311 reply_id: 313311[/import]