local col = 4 -- how many columns |||| = 4 columns local wid = display.contentWidth -- width of area local count = 20 -- number of objects for i = 1, count do local column = -(wid/(col\*2))+(i\*(wid/col)) - math.floor((i-1)/col)\*wid local row = math.floor((wid/(col\*2))+math.floor((i-1)/col)\*(wid/col)) local object = display.newRect(column,row,96,96) -- OR local object = display.newRect(column,row,wid/col,wid/col) -- this change sizes the object to fill the space end
Just thought it could help one of you out there! Enjoy.