MousePressed In Specific spot
in
Programming Questions
•
9 months ago
Hey folks. I'm doing a rollover and when I click within my sketch, the line changes from black to red. However, I want my mousePressed command only to change the color of the line when I click the line itself. How do I do that. Do I use an "if" function?
here's my code:
here's my code:
- void setup() {
size(240,120);
smooth();
strokeWeight(0);
}
void draw(){
background(#FFFFFF);
stroke(102);
if (mousePressed){
stroke(#C00000);
}else{
}
line(0,0,50,50);
}
1