GridMe #grid #processing #studenti #isia #rectmode #mousepressed
/*****************************
SKETCH PROCESSING
REALIZZATO DAGLI STUDENTI ISIA
SPECIALISTICA EDITORIA 2015/16
STEFANIA BORASCA
CARLO BUSTREO
GIADA MARSON
TOMMASO ???
VERONICA GARDINALI
*****************************/
void setup() {
size(400, 300);
}
void draw() {
background(0);
rectMode(CENTER);
stroke (pmouseX, pmouseY, 176);
rect(200, 150, 350, 250);
if (mousePressed == true)
{
for (int x = 50; x <= width-50; x += 20) {
for (int y = 50; y <= height-50; y+=20) {
strokeWeight(3);
stroke(pmouseX, pmouseY, 176);
point(x+2.5, y+2.5);
}
}
} else {
for (int x = 50; x <= width-50; x += 20) {
for (int y = 50; y <= height-50; y+=20) {
stroke(pmouseX, pmouseY, 176);
strokeWeight(3);
line(x+5, y-5, x-5, y+5);
}
}
}
fill (0);
ellipse(mouseX, mouseY,20,20);
}