controlP5 problem
in
Contributed Library Questions
•
1 year ago
hi,
I am using controlp5 library for my project to add tabs and sliders, but I confused, because it' not refreshing.
For instance if I move slider, it's previous value left on the screen. The code below it's just a part of my project code, but you clearly can see the problem.
How to solve that problem ?
Thanks for help.
- import controlP5.*;
- ControlP5 p5;
- Slider maxVolume, s, fone_color;
- RadioButton playerWave;
- void setup(){
- p5 = new ControlP5(this);
- size(400, 300);
- frameRate(30);
- smooth();
- fone_color = p5.addSlider("fone_color", 0, 255, 67, 200, 80, 10, 100);
- playerWave = p5.addRadioButton("Wave", 80, 100);
- setDefault(playerWave, "Sine", 1);
- addToRadioButton( playerWave , "Triangle", 2);
- s = p5.addSlider("slider1", 0, 255, 128, 30, 80, 10, 100);
- maxVolume = p5.addSlider("maxVolume", 0, 10, 0.5, 150, 80, 10, 100);
- p5.controller("fone_color").moveTo("references");
- p5.controller("slider1").moveTo("music");
- p5.trigger();
- }
- void draw(){
- }
- void addToRadioButton(RadioButton theRadioButton, String theName, int theValue ) {
- Toggle t = theRadioButton.addItem(theName, theValue);
- t.captionLabel().setVisible(true);
- }
- void setDefault(RadioButton theRadioButton, String theName, int theValue ) {
- Toggle t = theRadioButton.addItem(theName, theValue);
- t.captionLabel().setVisible(true);
- t.toggle();
- }
1