hi,
Any help please? Want the ellipses to change from blue to red when the mouse is over the slider/knob which moves them...have a look at the sketch to see what i mean..any help much appreciated!
cheers,
josh
- import controlP5.*;
- int pos1Y;
- int pos1X;
- int slider = pos1Y;
- int dial = pos1X;
- int slider1 = pos1Y;
- int dial1 = pos1X;
- int slider2 = pos1Y;
- int dial2 = pos1X;
- ControlP5 cp5;
- void setup() {
- background (255);
- smooth();
- size(700, 400);
- cp5 = new ControlP5(this);
- ControlWindow cw = cp5.addControlWindow("controlP5window", 208, 396, 800, 250, 30);
- Slider s = cp5.addSlider("slider", -150, 179.8, 40, 40, 129, 25, 120);
- Slider s1 = cp5.addSlider("slider1", -150, 179.8, 40, 140, 129, 25, 120);
- Slider s2 = cp5.addSlider("slider2", -150, 179.8, 40, 240, 129, 25, 120);
- s.setWindow(cw);
- s1.setWindow(cw);
- s2.setWindow(cw);
- s.setLabelVisible(false);
- s1.setLabelVisible(false);
- s2.setLabelVisible(false);
- Knob k = cp5.addKnob("dial", 0, width, 40, 90, 30);
- Knob k1 = cp5.addKnob("dial1", 0, width, 140, 90, 30);
- Knob k2 = cp5.addKnob("dial2", 0, width, 240, 90, 30);
- k.setWindow(cw);
- k1.setWindow(cw);
- k2.setWindow(cw);
- cw.setBackground(color(40));
- }
- void draw() {
- background(175);
- smooth();
- stroke (160);
- strokeWeight (0.2);
- line(dial, 0, dial, height);
- line(0, height-200-slider, width, height-200-slider);
- line(dial1, 0, dial1, height);
- line(0, height-200-slider1, width, height-200-slider1);
- line(dial2, 0, dial2, height);
- line(0, height-200-slider2, width, height-200-slider2);
- fill (0, 0, 255, 105);
- ellipse (dial, height-200-slider, 25, 25);
- ellipse (dial1, height-200-slider1, 25, 25);
- ellipse (dial2, height-200-slider2, 25, 25);
- }
1