08-29-2023, 03:21 PM
(08-28-2023, 01:33 AM)bplus Wrote: i -1 was about the letter indexes for the string. I am sure to keep the fist point drawn at x you have to subtract 1 from i to make a zero offset from x otherwise you will be a whole column right of where you need that first draw point.
Quote:Copy / paste above has odd format above,
- L16 - The reason we use
-1
in
COLS * scale% -1
and
ROWS * scale% - 1
is because in the first iteration of the loop with
i%
being 1, if we did not subtract one, it would offset them, and so the passed in desired positions would be actually offset for the first character.
Anyway, honestly maybe the -1's might not be necessary. Mathologically sometimes you need a -1 and sometimes you don't. A screen with 0,0 top, left corner has bottom right corner at _width -1, _Height -1
If x, y is top, left corner add width, height for bottom right or add width -1, height -1?
Best way to tell is try both. I just tried with the -1's and didn't see any problems.
I think our letter boxes would overlap without the -1's. That is if we outlined the space each letter resides in as boxes, the boxes would overlap without the -1's, whereas the boxes would neatly abut one another with the -1's.
Aha! @grymmjack this proves the -1's do neatly place the box spaces next to each other without overlap.
https://qb64phoenix.com/forum/showthread...6#pid19096
I fixed my own "Font Print" sub by adding -1's to the Step when drawing the pixelated boxes that form a letter.
Notice how you can see each pixel individually specially at the bottom b+ with 5x5 font.
b = b + ...