sorry, I may have mis-read your question:
you could try this. I set the offset to a negative value, so all the rects would show on screen.
local text = {} local cube = {} local horzOffset = -30 local vertOffset = 150 local qubeCnt = 1 cols = 3 rows = 3 for i = 1 , rows do for ii = 1, cols do cube[qubeCnt] = display.newRect(0,0,50,50) cube[qubeCnt].x = (ii \* 55) + horzOffset cube[qubeCnt].y = (i \* 55 ) + vertOffset text[qubeCnt] = display.newText(qubeCnt,0,0,"",25) text[qubeCnt]:setFillColor(0,0,0) text[qubeCnt].x = cube[qubeCnt].x text[qubeCnt].y = cube[qubeCnt].y qubeCnt = qubeCnt + 1 end end for i = 4, 6 do cube[qubeCnt] = display.newRect(0,0,50,50) cube[qubeCnt].x = (i \* 55) + horzOffset cube[qubeCnt].y = cube[3].y text[qubeCnt] = display.newText(qubeCnt,0,0,"",25) text[qubeCnt]:setFillColor(0,0,0) text[qubeCnt].x = cube[qubeCnt].x text[qubeCnt].y = cube[qubeCnt].y qubeCnt = qubeCnt + 1 end