Created
January 12, 2020 12:43
-
-
Save didacus/9249b4d30376a8eefc17d623a968223e to your computer and use it in GitHub Desktop.
P3 — Basic grid based on size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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