2

I have used Control-P5 library for drawing the text label

  void setup(){
    size(1400,800);
    cp5 = new ControlP5(this);
    myTextlabelB = new Textlabel(cp5,"Hello world",100,100,400,200);
 }

 void draw(){
    myTextlabelB.draw(this); 
    if(mousePressed){ 
        myTextlabelB.hide();
   // I want to hide the label here, but the hide function doesn't work
    }
}
Himanshu
  • 4,327
  • 16
  • 31
  • 39
Rakesh Adhikesavan
  • 11,966
  • 18
  • 51
  • 76

1 Answers1

0

There is some bug with hiding Textlable but it is working with Label class so you just need to get the label part and then hide it:

myTextlabelB.get().hide();

Also it is important to redraw your background at the beginning of the draw() function

background(0);
Majlik
  • 1,082
  • 1
  • 10
  • 20