RiTa
index
Name RiTextField
Description A simple text widget to handle user keyboard input

To capture the input from a RiTextField, you need to add the
method 'void onTextInput(String input)' to your sketch as follows:

     // called when 'enter' is typed in the text-field
     void onRiTaEvent(RiTaEvent re) 
     {
       String input = (String)re.getData();

       // do something with the text that was entered
       System.out.println("Text entered: "+input);
       ...
     }

Note: if you wish to change the key that triggers when text is captured, you can call textField.resetEnterCode(int codeForKeyToUseAsEnter);

Constructors
RiTextField(pApplet);
RiTextField(pApplet, x, y);
RiTextField(pApplet, x, y, width);
RiTextField(pApplet, x, y, width, height);
RiTextField(pApplet, x, y, width, height, fontSize);
RiTextField(pApplet, x, y, width, height, fontSize, initialText);
Methods
clear()   Clears any text in the text field

getEnterCode()   Returns the key that currently triggers 'enter' in the text field; the default value is 10, for the enter key on most keyboards.

getTextOffsetY()   Returns the current Y-offset for typed text

isVisible()   Returns true if the object is visible

resetEnterCode()   Resets the key that triggers 'enter' in the text field; the default value is 10, for the enter key on most keyboards. A value of -1 will disable this trigger (so that the entered text is never processed).

setActiveColor()  

setBgColor()  

setColor()  

setFgColor()  

setText()   Sets the text showing in the text field

setTextOffsetY()   Sets the Y-offset for typed text

setVisible()   Sets whether the text-field should be drawn (default=true)

Usage Web & Application