
Originally Posted by
Sixx93
.
Nope, the spaces aren't added automatically.
G.FillRectangle(Calc_arrayB(i), x * (k + 1), y * (k + 1), k, k)
is wrong.
First 2 loops would result in:
round 1
:
x = 0, y = 0, k = 10 (assume 10 for 'box size' -- 'k' doesn't change inside function, so doesn't really matter?)
0 * (k+1), 0 * (k+1)
x=0, y=0 == first grid location (starting at top-left). ok.
round 2
:
x = 1, y = 0, k = 10
1 * (k+1), 0*(k+1) //Scanning left-right, then top-down.
1* (11)
x = 11. not ok.
our first box's x position was at 0, our next one is at 11..if each box is '10 in size' it should be 0 to 9, with the next one starting at 10; but it starts at 11 - the equation is wrong.
edit: looks like simply
x * k would work to calculate the x pos. of each 'box'.
G.FillRectangle(Calc_arrayB(i), x * k, ****, k, k)
x=0,y=0,k=10;
0 * k = 0
next loop
1 * k = 10 //ok
next loop:
2 * k = 20
box 1 goes from 0 to 9, box 2 goes from 10 to 19, bot 3 goes from 20 to 29. Seems to follow the pattern.
I'm sure the yPosition is a similar story.