Skip to content

Instantly share code, notes, and snippets.

@didacus
Created January 12, 2020 12:43
Show Gist options
  • Save didacus/9249b4d30376a8eefc17d623a968223e to your computer and use it in GitHub Desktop.
Save didacus/9249b4d30376a8eefc17d623a968223e to your computer and use it in GitHub Desktop.
P3 — Basic grid based on size
void setup() {
size(800,800);
}
void draw() {
int tilesX = 10;
int tilesY = 1;
int tileW = int(width/tilesX);
int tileH = int(height/tilesY);
for (int x = 0; x < width; x += tileW) {
for (int y = 0; y < height; y+= tileH) {
stroke(255);
fill(0);
rect(x, y, tileW, tileH);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment