for (int i = 0; i < rectX.length; i++) {
if (overRect(rectX[i], rectY[i], rsize, rsize)) { // Better define constants to replace 50
stroke(rectCol[i]);
line(pmouseX, pmouseY, mouseX, mouseY);
// No need to test the other rects
}
for (int o = 0; o < circX.length; o++) {
if (overCirc(circX[0], circY[0], csize)) { //save picture to sketch folder
saveFrame("picture.jpg");
continue;
}
if (overCirc(circX[1], circY[1], csize)) { // start picture over
background(135);
line(pmouseX, pmouseY, mouseX, mouseY);
}
}
}
}
boolean overRect(int x, int y, int width, int height)
{
if (mouseX >= x && mouseX <= x+width &&
mouseY >= y && mouseY <= y+height) {
return true;
} else {
return false;
}
}
boolean overCirc(int x, int y, int diameter)
{
float disX = x - mouseX;
float disY = y - mouseY;
if(sqrt(sq(disX) + sq(disY)) < diameter/2 ) {
return true;
} else {
return false;
}
}
hello,
in my program id the strokeWeight of a line
to start at 0 and increase by 1 untill it gets to say 25,then decrease by 1 untill it gets to zero
and so on
in myprogram so far, once it gets to the maxiumum strokeweight is does not decrease