ControlP5 Issue
in
Contributed Library Questions
•
8 months ago
I have a second window with all my P5 controllers, but I cant find a way to add a toogle to the controller window.
Any ideas what I'm missing here:
- void setupUI(){
- controlP5 = new ControlP5(this);
- controlP5.setAutoDraw(false);
- controlWindow = controlP5.addControlWindow("UI",200,200,400,200);
- controlWindow.hideCoordinates();
- controlWindow.setBackground(color(40));
- Controller fadeSlider = controlP5.addSlider("fadeSpeed",0.0f,1.0f,40,40,100,10);
- fadeSlider.setWindow(controlWindow);
- Controller delta = controlP5.addSlider("delta",0.0000f,0.0100f,40,60,100,10);
- delta.setWindow(controlWindow);
- Controller visc = controlP5.addSlider("visc",0.0f,1.0f,40,80,100,10);
- visc.setWindow(controlWindow);
- //Missing toogels
- controlP5.addToggle("drawFluid",true,0,100,100,20).setMode(ControlP5.SWITCH);
- //this wont work, why?
- drawFluid.setWindow(controlWindow);
- controlP5.addToggle("drawLines",true,0,120,100,20).setMode(ControlP5.SWITCH);
- }
1