Closed bizkitj closed 7 years ago
Is there anyway we can "turn off" the lights effect on controller?
/** * ControlP5 with PeasyCam support. tested with peasy 0.8.2 * * by jeffg 2011 */ import peasy.*; import controlP5.*; import processing.opengl.*; PeasyCam cam; ControlP5 cp5; int buttonValue = 1; int myColor = color(255, 0, 0); void setup() { size(400, 400, P3D); cam = new PeasyCam(this, 100); cp5 = new ControlP5(this); cp5.addButton("button", 10, 100, 60, 80, 20).setId(1); cp5.addButton("buttonValue", 4, 100, 90, 80, 20).setId(2); cp5.setAutoDraw(false); } void draw() { background(0); lights(); fill(myColor); box(30); pushMatrix(); translate(0, 0, 20); fill(150); box(5); popMatrix(); // makes the gui stay on top of elements // drawn before. 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); }
Have you tried noLights(); before drawing the gui.
noLights();
:-),err, I am stupid. forgot this.
ok, you wanna close this issue then?
Thank you sojamo.
Is there anyway we can "turn off" the lights effect on controller?