Skip to content

OryUITextField

Kevin Cross edited this page Nov 29, 2020 · 7 revisions
- OryUITextField also requires OryUIStartTrackingTouch() and OryUIEndTrackingTouch() to exist in the main do loop

Available Functions

OryUICreateTextfield(parameters$)

Creates a textfield and returns a textfield ID. See Available Parameters section below for the options.

OryUIDeleteTextfield(textfieldID)

Deletes a textfield.

OryUIGetTextfieldHasFocus(textfieldID)

Returns the whether or not the textfield has focus.

OryUIGetTextfieldHeight(textfieldID)

Returns the height of the textfield.

OryUIGetTextfieldString(textfieldID)

Returns the textfield value.

OryUIGetTextfieldTrailingIconPressed(textfieldID)

Returns whether or not the trailing icon in the textfield was pressed.

OryUIGetTextfieldTrailingIconReleased(textfieldID)

Returns whether or not the trailing icon in the textfield was released.

OryUIGetTextfieldWidth(textfieldID)

Returns the width of the textfield.

OryUIGetTextfieldX(textfieldID)

Returns X position of the textfield.

OryUIGetTextfieldY(textfieldID)

Returns Y position of the textfield.

OryUIInsertTextfieldListener(textfieldID)

Inserts a textfield listener. Required in order to show the line at the bottom of the textfield when focused, and to move the textfield label.

OryUISetTextfieldString(textfieldID, string$)

Updates the textfield string/value.

OryUIUpdateTextfield(textfieldID, parameters$)

Updates a textfield. See Available Parameters section below for the options.

Available Parameters (all optional)

Parameter Description
backgroundColor The background colour of the textfield. Accepts RGB values, and RGBA values (comma delimited) Also accepts MakeColor() value/id, and hex color codes.
depth The depth of the textfield.
helperText The text shown in the helper text (displayed underneath the textfield).
helperTextColor The colour of the helper text. Accepts RGB values, and RGBA values (comma delimited) Also accepts MakeColor() value/id, and hex color codes.
inputText The text shown in the textfield.
inputType The type of textfield. Accepts int, integer, str, and string.
labelText The label and placeholder text shown in the textfield.
maxLength The max number of characters accepted in the textfield.
position The x and y position where the textfield should be placed, comma delimited.
showHelperText Whether or not to show the helper text. Accepts values true, false, 1 and 0.
showTrailingIcon Whether or not to show the trailing icon. Accepts values true, false, 1 and 0.
size The width and height of the textfield, comma delimited. Accepts decimals. ** Height is currently ignored **
strokeColor The colour of the textfield active line and label. Accepts RGB values, and RGBA values (comma delimited) Also accepts MakeColor() value/id, and hex color codes.
textColor The colour of the textfield text. Accepts RGB values, and RGBA values (comma delimited) Also accepts MakeColor() value/id, and hex color codes.
trailingIcon The trailing icon to show on the textfield. See the list of [Available Icons]
width The width of the textfield. Accepts decimals.
x The x position where the textfield should be placed.
y The y position where the textfield should be placed.

Example Code

To create a textfield

txtFldUsername = OryUICreateTextfield("labelText:Username;position:5,20;width:90")

Example

textfield1 = OryUICreateTextfield("position:11,20")
textfield2 = OryUICreateTextfield("position:11,30;backgroundColor:255,255,255,255;strokeColor:58,128,113,255;labelText:Username")
textfield3 = OryUICreateTextfield("position:11,40;backgroundColor:236,240,241,255;strokeColor:231,76,60,255;labelText:Location")
 
do
    OryUIStartTrackingTouch()
	
    OryUIInsertTextFieldListener(textfield1)
    OryUIInsertTextFieldListener(textfield2)
    OryUIInsertTextFieldListener(textfield3)

    OryUIEndTrackingTouch()
	
    Sync()
loop

Clone this wiki locally