When you only want to see the last line / temp var (in my code), show it via text() and don't use val.
That works together with background().
You can also choose a font and a fontsize and a color for the text.
text() also allows to define a rect that will not be exceeded even by too long text.
Hope this helps!
Greetings, Chrisir
like this...
- //String val="pwwe";
- int j=0;
- void setup()
- {
- size(500, 500);
- frameRate(1);
- textSize(32);
- }
- void draw()
- {
- background(111);
- //myPort.write("temp?");
- int i=0;
- String temp="";
- while ( i < 10) {
- temp = temp+char(i+j+65) ;
- i++;
- }
- j++;
- // val = temp+"\n"+val;
- //println(val);
- if (temp != null && temp.length() > 0) {
- text(temp, 50, 100, 110, 200);
- }
- }