hello guys, i want to make with a for loop something like a grid, means i have 8 images, with for i can display 4 of them in a row along the x, but now i want to display the next 4 in a row beneath.
how is it possible?
my code:
-- display the four balls on the screen and tweak their parameters local function setUpBalls() for i=1, 5 do local idx = colorBalls[i] mainBalls[idx] = display.newImage("images/" .. colorBalls[i] .. ".png") mainBalls[idx].height = 110 mainBalls[idx].width = 110 mainBalls[idx].x = 138 \* i - 24 mainBalls[idx].y = 20 \* i mainBalls[idx].alpha = 0.7 mainBalls[idx].color = colorBalls[i] mainBalls[idx].sound = audio.loadSound("audio/" .. colorBalls[i] .. ".aiff") mainBalls[idx]:addEventListener ( "touch", ballTouched ) end end