Method of distribution is not important just that the objects do not overlap(only one dimension varies ) and that there are N of them in a row or a column. Would appreciate your help.
you can do it with these 2 nested loops:
How it works:
The inner loop (calculate x positions) calculates the x positions by reassigning the currentX value in the loop by just adding the size of each object.
The outer loop just calls the inner loop for each y line and give it the right y-value.