Hi i’m trying to execute a code but i’m incurring into some problems. The first problem is the rendering execution of the GUI’s text (controlP5) of my big program. To fix that, i’m trying to execute a little code, but it doesn’t get compiled. I code into visual studio using .java files importing processing.core. * . I tried executing into processing editor but it doesn’t compile again. The console show this error:
ControlP5 0.5.4 infos, comments, questions at processing GUI, controlP5
but actually the latest version of this package should be 2.2.5 .
My code:
package vis;
import peasy.*;
import controlP5.*;
import controlP5.Textfield;
import processing.core.*;
import processing.opengl.*;
public class Test extends PApplet {
public static void main(String _args[]) {
PApplet.main(new String[] { vis.Test.class.getName() });
}
PeasyCam cam;
ControlP5 cp5;
Button a,b;
int buttonValue = 1;
int myColor = color(255, 0, 0);
public void setting(){
size(800, 800, P3D);
}
public void setup() {
cam = new PeasyCam(this, 100);
cp5 = new ControlP5(this);
a = cp5.addButton("button");
a.setValue(10);
a.setPosition(100, 60);
a.setSize(80, 20);
a.setId(1);
b = cp5.addButton("buttonValue");
b.setValue(4);
b.setPosition(100, 90);
b.setSize( 80, 20);
b.setId(2);
cp5.setAutoDraw(false);
}
public void draw() {
background(0);
fill(myColor);
box(30);
pushMatrix();
translate(0, 0, 20);
fill(0, 0, 255);
box(5);
popMatrix();
gui();
}
void gui() {
hint(DISABLE_DEPTH_TEST);
cam.beginHUD();
cp5.draw();
cam.endHUD();
hint(ENABLE_DEPTH_TEST);
}
void controlEvent(ControlEvent theEvent) {
println(theEvent.getController().getId());
}
void button(float theValue) {
myColor = color(random(255), random(255), random(255));
println("a button event. "+theValue);
}
}
My question are:
- There’s a fix for bad text rendering of controlP5 GUI into P3D ? Should i use another GUI?
- How can i update the package controlP5 into visual studio?
- Why my code doesn’t compile?