Drawing a Grid

Learn how to make certain types of games and use gameEditor.

Drawing a Grid

Postby Hblade » Fri Jan 11, 2013 5:13 am

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!
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest