|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gicentre.utils.gui.TextInput
public class TextInput
Class for creating a text-field type input area. Typed text is displayed on screen with a simple caret. Can be used for single or multiple lines. No decoration of the input area is provided but this can be added externally.
Constructor Summary | |
---|---|
TextInput(processing.core.PApplet parent,
processing.core.PFont font,
float textSize)
Initialises the text input area with the given font. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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.Method Detail |
---|
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |