changing strokeWeight
in
Programming Questions
•
3 years ago
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
float value1=0;
void setup(){
background(255);
size(1300,700);
}
void draw(){
if((mousePressed)&& (mouseButton==LEFT)){
strokeWeight(value1);
stroke(random(200),random(200),random(200));
line(pmouseX,pmouseY,mouseX,mouseY);
value1=value1+.5;
}
if(value1>25){
value1=value1-1;
}
}
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
float value1=0;
void setup(){
background(255);
size(1300,700);
}
void draw(){
if((mousePressed)&& (mouseButton==LEFT)){
strokeWeight(value1);
stroke(random(200),random(200),random(200));
line(pmouseX,pmouseY,mouseX,mouseY);
value1=value1+.5;
}
if(value1>25){
value1=value1-1;
}
}
1