我使用Control-P5库绘制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
}
}发布于 2014-05-05 12:17:20
隐藏Textlable有一些bug,但是它使用的是Label类,所以您只需要获取label部件,然后隐藏它:
myTextlabelB.get().hide();另外,在draw()函数开始时重新绘制背景也很重要。
background(0);https://stackoverflow.com/questions/23465728
复制相似问题