/**
* Simple multi line text input field for Processing
*
* Simple sketch to demonstrate the GTextArea class.
* This component allows the user to enter and edit text.
* Simple multi line text input field for Processing
*/
import g4p_controls.*;
GTextArea txaSample;
int bgcol = 32;
String startText;
public void setup() {
size(350, 360);
//Some sample text:
startText = "Hey! Put your text here! Taht's simple.";
// Create a text area with both horizontal and
// vertical scrollbars that automatically hide
// when not needed.
txaSample = new GTextArea(this, 10, 10, 200, 300, G4P.SCROLLBARS_BOTH | G4P.SCROLLBARS_AUTOHIDE);
txaSample.setText(startText, 170); // 170 is the width of the text
// Set color scheme:
// Available schemes: BLUE_SCHEME, GREEN_SCHEME, RED_SCHEME, PURPLE_SCHEME YELLOW_SCHEME, CYAN_SCHEME, GREY_SCHEME
txaSample.setLocalColorScheme(GCScheme.CYAN_SCHEME);
}
public void draw() {
background(200);
}