public class TextInput
extends java.lang.Object
Constructor and Description |
---|
TextInput(processing.core.PApplet parent,
processing.core.PFont font,
float textSize)
Initialises the text input area with the given font.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(float x,
float y)
Displays the currently entered input text at the given coordinates.
|
java.lang.String |
getText()
Reports the text that has been entered in the input field.
|
void |
keyPressed()
Updates the text input area with whatever is typed in with the keyboard.
|
void |
setText(java.lang.String text)
Sets the text to be displayed in the text input area.
|
public TextInput(processing.core.PApplet parent, processing.core.PFont font, float textSize)
parent
- Sketch in which this text input area is to appear.font
- Font used to display text.textSize
- Size of text to display in pixel units.public void draw(float x, float y)
x
- X-coordinate of the top-left of the input fieldy
- Y-coordinate of the top-left of the input field.public void keyPressed()
keyPressed()
method.public void setText(java.lang.String text)
text
- Text to display in text input area. Can be empty if you wish to 'reset' the field.public java.lang.String getText()