"Usage: PApplet <appletname> For Additional Options, see the JavaDoc for PApplet" Possible ControlP5 issue?
in
Contributed Library Questions
•
3 years ago
Hope someone can help me with this, Im getting the above message whenever I try to compile my code - which worked perfectly fine before and now for some reason doesnt.
Its meant to be using, mainly, the controlP5 library. The whole program has 3 windows; the main window, one controlWindow for a GUI, and a separate PApplet window that displays graphics manipulated by OSC messages from PD. It seems to be the latter window thats causing all the grief. Heres a chunk of the code;
ControlWindow boids;
ControlWindowCanvas boidC;
int [] xpos = new int [50];
int [] ypos = new int [50];- int xBall1;
int yBall1;
int fluxBall1;
boolean playing; - void boidsSetup(){
frameRate(30);
controlP5 = new ControlP5(this);
boids = controlP5.addControlWindow("Boids",100,100,400,400,30);
boids.setUpdateMode(ControlWindow.NORMAL);
boidC = new Canvas();
boidC.pre();
boids.addCanvas(boidC);
boids.hideCoordinates();
boids.frameRate(25);
boids.setBackground(color(0,0,20));
oscP5.plug(this,"coords","/coords");
for (int i = 0; i < xpos.length; i++){
xpos[i] = 0;
ypos[i] = 0;
}
} - void coords (float temp_x, float temp_y, float temp_flux){
xBall1 = round(temp_x);
yBall1 = round(temp_y);
fluxBall1 = round(temp_flux);
} - class Canvas extends ControlWindowCanvas {
public void draw(PApplet boidAp) {
boidAp.background (0);
boidAp.noStroke();
boidAp.noCursor();
boidAp.smooth();
for (int i = 0; i < xpos.length-1; i++){
xpos[i] = xpos[i+1];
ypos[i] = ypos[i+1];
}
xpos[xpos.length-1] = xBall1 + round(fluxBall1*0.01);
ypos[ypos.length-1] = yBall1 + round(fluxBall1*0.01);
for (int i = 0; i < xpos.length; i++){
//fill(0+((i* 255/xpos.length)*1),255-((i* 255/xpos.length)*-1),0+((i* 5/xpos.length)*1),255-((i* 255/xpos.length)*-1));
for(int j = 0; j < 50; j++){
boidAp.fill(255-(i* 255/xpos.length)+(j* 255/50),0+(i* 255/xpos.length)-(j* 255/50),0+(i* 255/xpos.length),0+(i* 255/xpos.length)-(j* 255/50));
boidAp.ellipse(xpos[i]*(j*(0.1 * -1))+400,ypos[i]*(j*(0.1 * -1))+400,i*((j*0.1)/10),i*(j*0.1)/10);
boidAp.fill(255-(i* 255/xpos.length)+(j* 255/50),0+(i* 255/xpos.length),255-(i* 255/xpos.length)-(j* 255/50),0+(i* 255/xpos.length)-(j* 255/50));
boidAp.ellipse(xpos[i]*(j*0.1),ypos[i]*(j*0.1),i*((j*0.1)/10),i*(j*0.1)/10);
}
}
}
} Many thanks
-
-Dave
2