Page 1 of 1

Drawing a Grid

PostPosted: Fri Jan 11, 2013 5:13 am
by Hblade
If you want to draw a grid with a canvas, you can do so easilly.

First, All you have to do is this
Code: Select all
int i;
erase(R, G, B, 0);
setpen(R, G, B, 0, 1);
for(i=0;i<width;i+=32)
{
    moveto(i, 0);
    lineto(i, height);
}
for(i=-3;i<32;i+=32)
{
    moveto(0, i);
    lineto(width, i);
}


To change the size, just replace the 32's with the grid of your choice!