control p5 textlabel, doesn't seem to erase previous value when value is changed?
in
Contributed Library Questions
•
2 years ago
my knowledge of processing is that is redraws everything each time through the draw() function so i'm a little confused by the behavior of the textlabel object from the controlP5 library
http://www.sojamo.de/libraries/controlP5/reference/controlP5/Textlabel.html
picking almost directly from example in textlabel doc page, some code omitted for clarity
so this successfully changes the value of the textlabelA, and B from that in the setup() function, but as the int remChars changes, the window still seems to be displaying all the previous versions of the remChars text as well so that area become quickly filled in as remChars changes through values, in both labelA and labelB.
i'm guessing i have to somehow manually clear it from the screen each time i change the text?
thanks,
dan
i was using the native processing "text" function but it seems that als behaves strangely when using the controlp5 textfield and textlabel object. something about some font and other settings seems to be interacting behind the scenes...
http://www.sojamo.de/libraries/controlP5/reference/controlP5/Textlabel.html
picking almost directly from example in textlabel doc page, some code omitted for clarity
- setup(){
- controlP5.setControlFont(new ControlFont(createFont("Georgia",14), 14));
- myTextlabelA = controlP5.addTextlabel("label","test a",20,74);
- myTextlabelA.setColorValue(0xffcccccc);
- myTextlabelB = new Textlabel(this,"test label b",20,20,300,200);
- }
- void draw(){
- // some other code in here, the remChars variable changes with time...
- myTextlabelB = new Textlabel(this,"characters remaining " + remChars,20,20,300,200);
- myTextlabelB.draw(this);
- myTextlabelA.setValue("----------------changed text with remChars = "+remChars);
- }
so this successfully changes the value of the textlabelA, and B from that in the setup() function, but as the int remChars changes, the window still seems to be displaying all the previous versions of the remChars text as well so that area become quickly filled in as remChars changes through values, in both labelA and labelB.
i'm guessing i have to somehow manually clear it from the screen each time i change the text?
thanks,
dan
i was using the native processing "text" function but it seems that als behaves strangely when using the controlp5 textfield and textlabel object. something about some font and other settings seems to be interacting behind the scenes...
1