We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I try to use a messagebox if the mouse over some elements. But the Elements of cp5 are every time in foreground. How can I draw a rect over the buttons?
See like this:
import controlP5.*;
ControlP5 cp5;
void setup() {
size(400, 600);
cp5 = new ControlP5(this);
cp5.addButton("A")
.setValue(0)
.setPosition(100, 100)
.setSize(200, 19)
;
}
void draw() {
background(120);
rect(mouseX, mouseY, 40, 100);
}
Answers
Find a solution:
controlP5 / ControlP5 / setAutoDraw( )
name setAutoDraw ( )
description by default controlP5 draws any controller on top of any drawing done in the draw() function (this doesnt apply to P3D where controlP5.draw() has to be called manually in the sketch's draw() function ). to turn off the auto drawing of controlP5, use controlP5.setAutoDraw(false). now you can call controlP5.draw() any time whenever controllers should be drawn into the sketch.
@andreas.schlegel: awesome libary! i can do everything :)