Hi, hope someone can help - I am trying to make a grid that when you mouse is clicked it adds another column and row - like an ever expanding grid -
I have the base set up for a grid and i know i need a void mouseFunction - but unsure how to weave it all together?
float tilesX, tilesY, tileW, tileH;
void setup() {
size(900, 900);
tilesX = 4;
tilesY = 4;
//translate(width = mouseX,height = mouseY);
tileW = width / tilesX;
tileH = height / tilesY;
}
void draw() {
background(0);
ellipseMode(CORNER);
for (int x = 0; x < tilesX; x++) {
for (int y = 0; y < tilesY; y++) {
rect(x*tileW, y*tileH, tileW, tileH);
}
}
}