mousePressed() function

omg.
my program doesnt need the + sign. its up to you. what i did was,if you press the mouse.the circle will show. else it will not. but if you want it to show “onclick” here.

int showCirle = 0;
//draw
if(mousePressed){
 showCircle=showCirle+1;
//nested loop
if(showCircle>1){
 showCircle=0;}
}
//now the above function is to make sure this falls back to zero when showCircle has past one
//now for the real deal
//draw
if(showCircle==1){
fill(255,0,0);//red
ellipse(500,500,20);//or use ur own circle(500,500,20); assuming its an object you made.
}
1 Like