Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

cp5 textArea multiline

$
0
0

Hello.

I wants to show text in the Textarea ouput in mode multiline: every time I press Return on TextField input shows a different line but don't work! any solution? please : )


import controlP5.*;

ControlP5 cp5;

String textValue = "";

Textfield input; Textarea output;

StringList script;

int index = 0; void setup() { size(1000,700, P3D); frameRate(15);

PFont font = createFont("arial",20);

cp5 = new ControlP5(this);

script = new StringList();

input = cp5.addTextfield("input") .setColor(color(0)) .setColorBackground(color(255,255,255,29)) .setColorCursor(color(0)) .setPosition(10,10) .setSize(980,40) .setFont(font) .setFocus(true) ;

output = cp5.addTextarea("output") .setColor(color(0)) .setColorBackground(color(255,255,255,29)) //.setColorCursor(color(0)) .setPosition(10,70) .setSize(980,600) .setFont(font) ;

}

void draw() { background(255);

}

void controlEvent(ControlEvent theEvent){ index = index + 1; textValue = input.getText(); //println(textValue); script.append(textValue); String item = script.get(index-1); item +=item + "\n"; output.setText(item + "\n"); //println(script); }


Viewing all articles
Browse latest Browse all 2896

Trending Articles