Script documentation

InputField.cs in TinyGiantStudio.Text namespace

If anything except method names starts with a capital letter, it's a property.

Utility

Variable

Variable
Type
Description

autoFocusOnGameStart

bool

If set to true, this is focused on awake. The slider is scrollable with a keyboard when focused. If it is in a list, the list controls who to focus on.

interactable

bool

As the name suggests, if it isn't interactable nothing can interact with it and it gets ignored in a list.

Text

string

The current text in the inputfield. Directly assigning the Text property makes a sound If it has both Audioclip and Audio Source.

placeHolderText

string

The text to show when the actual text to show is empty. For example, if an input field for a username is empty, the placeholder can show "User name" to indicate to the user that this is a field for a username.

maxCharacter

int

caret

string

hideCaretIfMaxCharacter

contentType

textComponent

enterKeyEndsInput

bool

Methods

Method

InputComplete ()

EmptyText ()

Select ()

Focus (bool enable)

There is a one-frame delay before this takes effect.

This is to avoid pressing the Enter key in one List and having the same Enter key applied to another UI that just got enabled by it on the same frame.

OpenTouchScreenKeyboard ()

CloseTouchScreenKeyboard ()

Interactable ()

Uninteractable ()

Events

Variable
Type
Description

onInput

UnityEvent

onBackspace

UnityEvent

onInputEnd

UnityEvent

Style

Variable
Type
Description

background

Renderer

placeHolderTextMat

Material

inFocusTextMat

Material

inFocusBackgroundMat

Material

outOfFocusTextMat

Material

Material

disabledTextMat

Material

disabledBackgroundMat

Material

hoveredBackgroundMaterial

Material

Version History

v4.2.0 (Aug 31, 2023)

  1. outOfFocusBackgroundMat renamed to normalBackgroundMaterial

  2. hoveredBackgroundMaterial has been added

  3. FocusToggle() has been added.

v4.0.3 (June 2, 2023)

  • Added method OpenTouchScreenKeyboard() and CloseTouchScreenKeyboard()

Last updated