Hi,
Could you help me? I am new using controlp5, and I have 2 questions:
1)The control windows are hidden by the main sketch...
Is there a way to move backwards the controlwindows?
I am using 2 control windows in the sketch, and those are hidden by the main sketch,
2)Is there a way to set the main window at position of 0,0 each time it appears?
thank you
here is the code:
//-------
import controlP5.*;
ControlP5 cp5;
int myColorBackground = color(0,0,0);
ControlWindow controlWindow,controlWindow2;
PImage ima;
public int sliderValue = 40;
void setup() {
size(900,900);
background(0);
cp5 = new ControlP5(this);
cp5.setPosition(0,0,this);
controlWindow = cp5.addControlWindow("tinlarin",0,800,400,200)
.hideCoordinates()
.setBackground(color(40,20,189,20))
.setLocation(100,100)
.setUpdateMode(NORMAL)
;
controlWindow2 = cp5.addControlWindow("nones",400,700,400,200)
.hideCoordinates()
.setBackground(color(4,210,20,230))
;
cp5.addSlider("sliderValue")
.setRange(0,255)
.setPosition(40,40)
.setSize(200,29)
.setWindow(controlWindow)
.setUpdateMode(NORMAL)
;
cp5.getPointer();
}
void draw() {
background(sliderValue);
color(145,324,23,30);
fill(109,202,181,30);
ellipse(100,100,50,50);
if ((frame.getState() == 1) && (controlWindow.isVisible())) {
controlWindow.hide();
}
}
1