We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hi i want to add this pie graph that turns into an circle into my main sketch but i want to be able to click once and the pie graph turns into a circle and when i put it it doesn't work. Could someone pls help me put this into my main sketch and tell me how to use the mousePressed function so that i click once and the graph turns into a circle
thanks
int arcsize=600;
int shrinkorgrow;
int diameter = 300;
int[] angle2 = {70,60,100,60,70};
float lastangle2 = 0;
int i=0;
void setup(){
size(1000,1000);
frameRate(5);
}
void draw() {
//check the size of arc
if(arcsize>299){
shrinkorgrow=0;
}else if (arcsize<101){
shrinkorgrow=1;
}arc(width/2, height/2, diameter, diameter, lastangle2, lastangle2+radians(angle2[i]));
lastangle2 += radians(angle2[i]);
fill(9,123,178) ;
}
Answers
this reacts on mousePressed
thankyou
it worked