Looks like a scope issue. Once I comment out your 'control()' function in setup, which isn't included in your code, I get a "Cannot find anything named 'posx'" error. 'posx' is a variable defined within the drawOneCircle() function. Just because you call umbrella() from within the function doesn't mean it has access to local variables. You could simply add appropriate parameters to the umbrella function and pass these when you call it from drawOneCircle:
Code:import controlP5.*;
ControlP5 controlP5;
boolean pause = false;
int backgroundColor = color(200);
void setup(){
smooth();
size(1600,800);
frameRate(10);
controlP5 = new ControlP5(this);
//control();
reset();
}
void reset(){
background(backgroundColor);
}
void draw() {
if (pause == false){
drawOneCircle();
}
}
void drawOneCircle(){
int posx = int(random(0,width));
int posy = int(random(0,height));
float radius = random(10,50);
noStroke();
fill(0,10);
ellipse(posx,posy,radius*4,radius*4);
ellipse(posx,posy,radius*3,radius*3);
ellipse(posx,posy,radius*2.5,radius*2.5);
fill(255);
ellipse(posx,posy,radius*2,radius*2);
umbrella(posx, posy, radius);
}
void umbrella(int posx, int posy, float radius){
stroke(0);
for(float i = 0.0; i < 2.0*PI; i+=0.5){
line(posx,posy,posx+sin(i)*radius,posy+cos(i)*radius);
}
}
Then you also have the option of calling an umbrella without drawing a circle; which you must want to do if you're separating the code into a separate function...