My ControlP5 slider is not responding
in
Contributed Library Questions
•
11 months ago
As the title says - the slider does not respond to clicks. What to do? Here's my code*:
Would love any help.
*it's probably not the neatest of codes, I'm just hacking away at this, like the newbie I am. Might be related to my problem. :)
float r = 75;
float theta = 0;
int t = 1;
int frb=1;
import controlP5.*;
ControlP5 cp5;
int sliderValue = 100;
Slider abc;
void setup() {
size(800, 800);
background(255, 200);
smooth();
frameRate(60);
cp5 = new ControlP5(this);
// add a horizontal sliders, the value of this slider will be linked
// to variable 'sliderValue'
cp5.addSlider("sliderValue")
.setPosition(-300, -300)
.setRange(0, 255)
;
}
void draw() {
sliderValue=frb;
translate(width/2, height/2);
pushMatrix();
background(255); //tried to set alpha very low. didnt work.
translate(1, 1);
for (int i = 1; i<70; i++) {
// Polar to Cartesian conversion
float x = r * cos(theta);
float y = r * sin(theta);
//float x = (sin(frb));
stroke(i/3, 3);
noFill();
//ellipse(pow(x, i/340) + width/2 -random(i*2), y + height/2, i, y);
ellipse(frb, x, 20, y);
rotate(frb/1000);
// Increment the angle
theta += .05;
t = t+1;
}
popMatrix();
}
Thanks!
1