Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Properties | List of all members
TMPro.TMP_InputField Class Reference

Editable text input field. More...

Inheritance diagram for TMPro.TMP_InputField:

Classes

class  OnChangeEvent
 
class  SelectionEvent
 
class  SubmitEvent
 
class  TextSelectionEvent
 

Public Types

enum  CharacterValidation {
  CharacterValidation.None, CharacterValidation.Digit, CharacterValidation.Integer, CharacterValidation.Decimal,
  CharacterValidation.Alphanumeric, CharacterValidation.Name, CharacterValidation.Regex, CharacterValidation.EmailAddress,
  CharacterValidation.CustomValidator
}
 
enum  ContentType {
  ContentType.Standard, ContentType.Autocorrected, ContentType.IntegerNumber, ContentType.DecimalNumber,
  ContentType.Alphanumeric, ContentType.Name, ContentType.EmailAddress, ContentType.Password,
  ContentType.Pin, ContentType.Custom
}
 
enum  InputType { InputType.Standard, InputType.AutoCorrect, InputType.Password }
 
enum  LineType { LineType.SingleLine, LineType.MultiLineSubmit, LineType.MultiLineNewline }
 

Public Member Functions

void ActivateInputField ()
 
void DeactivateInputField ()
 
void ForceLabelUpdate ()
 
virtual void GraphicUpdateComplete ()
 
virtual void LayoutComplete ()
 
void MoveTextEnd (bool shift)
 Move to the end of the text. More...
 
void MoveTextStart (bool shift)
 Move to the start of the text. More...
 
void MoveToEndOfLine (bool shift, bool ctrl)
 Move to the end of the current line of text. More...
 
void MoveToStartOfLine (bool shift, bool ctrl)
 Move to the start of the current line of text. More...
 
virtual void OnBeginDrag (PointerEventData eventData)
 
void OnControlClick ()
 
override void OnDeselect (BaseEventData eventData)
 
virtual void OnDrag (PointerEventData eventData)
 
virtual void OnEndDrag (PointerEventData eventData)
 
virtual void OnPointerClick (PointerEventData eventData)
 
override void OnPointerDown (PointerEventData eventData)
 
virtual void OnScroll (PointerEventData eventData)
 
override void OnSelect (BaseEventData eventData)
 
virtual void OnSubmit (BaseEventData eventData)
 
virtual void OnUpdateSelected (BaseEventData eventData)
 
delegate char OnValidateInput (string text, int charIndex, char addedChar)
 
void ProcessEvent (Event e)
 
virtual void Rebuild (CanvasUpdate update)
 
void SetGlobalFontAsset (TMP_FontAsset fontAsset)
 Function to conveniently set the Font Asset of both Placeholder and Input Field text object. More...
 
void SetGlobalPointSize (float pointSize)
 Function to conveniently set the point size of both Placeholder and Input Field text object. More...
 

Protected Types

enum  EditState { EditState.Continue, EditState.Finish }
 

Protected Member Functions

virtual void Append (string input)
 Append the specified text to the end of the current. More...
 
virtual void Append (char input)
 
void ClampCaretPos (ref int pos)
 
void ClampStringPos (ref int pos)
 
override void DoStateTransition (SelectionState state, bool instant)
 
EditState KeyPressed (Event evt)
 
virtual void LateUpdate ()
 Update the text based on input. More...
 
override void OnDisable ()
 
override void OnEnable ()
 
void OnFocus ()
 
void SelectAll ()
 
void SendOnEndEdit ()
 Submit the input field's text. More...
 
void SendOnEndTextSelection ()
 
void SendOnFocus ()
 
void SendOnFocusLost ()
 
void SendOnSubmit ()
 
void SendOnTextSelection ()
 
 TMP_InputField ()
 
void UpdateLabel ()
 Update the visual text Text. More...
 
char Validate (string text, int pos, char ch)
 Validate the specified input. More...
 

Protected Attributes

int m_CaretPosition = 0
 
int m_CaretSelectPosition = 0
 
bool m_CaretVisible
 
UIVertex[] m_CursorVerts = null
 
TMP_FontAsset m_GlobalFontAsset
 
TMP_InputValidator m_InputValidator = null
 
bool m_isRichTextEditingAllowed = true
 
bool m_isSelectAll
 
TouchScreenKeyboard m_Keyboard
 
Mesh m_Mesh
 
bool m_OnFocusSelectAll = true
 
Graphic m_Placeholder
 
bool m_ResetOnDeActivation = true
 
float m_ScrollSensitivity = 1.0f
 
int m_StringPosition = 0
 
int m_StringSelectPosition = 0
 
string m_Text = string.Empty
 Input field's value. More...
 
TMP_Text m_TextComponent
 
RectTransform m_TextComponentRectTransform
 
RectTransform m_TextViewport
 Text Text used to display the input's value. More...
 
Scrollbar m_VerticalScrollbar
 
TMP_ScrollbarEventHandler m_VerticalScrollbarEventHandler
 

Properties

char asteriskChar [get, set]
 
float caretBlinkRate [get, set]
 
Color caretColor [get, set]
 
int caretPosition [get, set]
 Get: Returns the focus position as thats the position that moves around even during selection. Set: Set both the anchor and focus position such that a selection doesn't happen More...
 
int caretPositionInternal [get, set]
 Current position of the cursor. Getters are public Setters are protected More...
 
int caretSelectPositionInternal [get, set]
 
int caretWidth [get, set]
 
int characterLimit [get, set]
 
CharacterValidation characterValidation [get, set]
 
ContentType contentType [get, set]
 
bool customCaretColor [get, set]
 
TMP_FontAsset fontAsset [get, set]
 Sets the Font Asset on both Placeholder and Input child objects. More...
 
InputType inputType [get, set]
 
TMP_InputValidator inputValidator [get, set]
 Sets the Input Validation to use a Custom Input Validation script. More...
 
bool isFocused [get]
 
bool isRichTextEditingAllowed [get, set]
 Is Rich Text editing allowed? More...
 
TouchScreenKeyboardType keyboardType [get, set]
 
LineType lineType [get, set]
 
Mesh mesh [get]
 
bool multiLine [get]
 
SelectionEvent onDeselect [get, set]
 
SubmitEvent onEndEdit [get, set]
 
TextSelectionEvent onEndTextSelection [get, set]
 
bool onFocusSelectAll [get, set]
 Determines if the whole text will be selected when focused. More...
 
SelectionEvent onSelect [get, set]
 
SubmitEvent onSubmit [get, set]
 
TextSelectionEvent onTextSelection [get, set]
 
OnValidateInput onValidateInput [get, set]
 
OnChangeEvent onValueChanged [get, set]
 
Graphic placeholder [get, set]
 
float pointSize [get, set]
 Set the point size on both Placeholder and Input text object. More...
 
bool readOnly [get, set]
 
bool resetOnDeActivation [get, set]
 Determines if the text and caret position as well as selection will be reset when the input field is deactivated. More...
 
bool restoreOriginalTextOnEscape [get, set]
 Controls whether the original text is restored when pressing "ESC". More...
 
bool richText [get, set]
 
float scrollSensitivity [get, set]
 
int selectionAnchorPosition [get, set]
 Get: Returns the fixed position of selection Set: If Input.compositionString is 0 set the fixed position More...
 
Color selectionColor [get, set]
 
int selectionFocusPosition [get, set]
 Get: Returns the variable position of selection Set: If Input.compositionString is 0 set the variable position More...
 
int selectionStringAnchorPosition [get, set]
 The fixed position of the selection in the raw string which may contains rich text. More...
 
int selectionStringFocusPosition [get, set]
 The variable position of the selection in the raw string which may contains rich text. More...
 
bool shouldHideMobileInput [get, set]
 Should the mobile keyboard input be hidden. More...
 
int stringPosition [get, set]
 
int stringPositionInternal [get, set]
 
int stringSelectPositionInternal [get, set]
 
string text [get, set]
 Input field's current text value. More...
 
TMP_Text textComponent [get, set]
 
RectTransform textViewport [get, set]
 
Scrollbar verticalScrollbar [get, set]
 
bool wasCanceled [get]
 

Detailed Description

Editable text input field.

Member Enumeration Documentation

Enumerator
None 
Digit 
Integer 
Decimal 
Alphanumeric 
Name 
Regex 
EmailAddress 
CustomValidator 
Enumerator
Standard 
Autocorrected 
IntegerNumber 
DecimalNumber 
Alphanumeric 
Name 
EmailAddress 
Password 
Pin 
Custom 
Enumerator
Continue 
Finish 
Enumerator
Standard 
AutoCorrect 
Password 
Enumerator
SingleLine 
MultiLineSubmit 
MultiLineNewline 

Constructor & Destructor Documentation

TMPro.TMP_InputField.TMP_InputField ( )
inlineprotected

Member Function Documentation

void TMPro.TMP_InputField.ActivateInputField ( )
inline
virtual void TMPro.TMP_InputField.Append ( string  input)
inlineprotectedvirtual

Append the specified text to the end of the current.

virtual void TMPro.TMP_InputField.Append ( char  input)
inlineprotectedvirtual
void TMPro.TMP_InputField.ClampCaretPos ( ref int  pos)
inlineprotected
void TMPro.TMP_InputField.ClampStringPos ( ref int  pos)
inlineprotected
void TMPro.TMP_InputField.DeactivateInputField ( )
inline
override void TMPro.TMP_InputField.DoStateTransition ( SelectionState  state,
bool  instant 
)
inlineprotected
void TMPro.TMP_InputField.ForceLabelUpdate ( )
inline
virtual void TMPro.TMP_InputField.GraphicUpdateComplete ( )
inlinevirtual
EditState TMPro.TMP_InputField.KeyPressed ( Event  evt)
inlineprotected
virtual void TMPro.TMP_InputField.LateUpdate ( )
inlineprotectedvirtual

Update the text based on input.

virtual void TMPro.TMP_InputField.LayoutComplete ( )
inlinevirtual
void TMPro.TMP_InputField.MoveTextEnd ( bool  shift)
inline

Move to the end of the text.

Parameters
shift
void TMPro.TMP_InputField.MoveTextStart ( bool  shift)
inline

Move to the start of the text.

Parameters
shift
void TMPro.TMP_InputField.MoveToEndOfLine ( bool  shift,
bool  ctrl 
)
inline

Move to the end of the current line of text.

Parameters
shift
void TMPro.TMP_InputField.MoveToStartOfLine ( bool  shift,
bool  ctrl 
)
inline

Move to the start of the current line of text.

Parameters
shift
virtual void TMPro.TMP_InputField.OnBeginDrag ( PointerEventData  eventData)
inlinevirtual
void TMPro.TMP_InputField.OnControlClick ( )
inline
override void TMPro.TMP_InputField.OnDeselect ( BaseEventData  eventData)
inline
override void TMPro.TMP_InputField.OnDisable ( )
inlineprotected
virtual void TMPro.TMP_InputField.OnDrag ( PointerEventData  eventData)
inlinevirtual
override void TMPro.TMP_InputField.OnEnable ( )
inlineprotected
virtual void TMPro.TMP_InputField.OnEndDrag ( PointerEventData  eventData)
inlinevirtual
void TMPro.TMP_InputField.OnFocus ( )
inlineprotected
virtual void TMPro.TMP_InputField.OnPointerClick ( PointerEventData  eventData)
inlinevirtual
override void TMPro.TMP_InputField.OnPointerDown ( PointerEventData  eventData)
inline
virtual void TMPro.TMP_InputField.OnScroll ( PointerEventData  eventData)
inlinevirtual

Parameters
eventData
override void TMPro.TMP_InputField.OnSelect ( BaseEventData  eventData)
inline
virtual void TMPro.TMP_InputField.OnSubmit ( BaseEventData  eventData)
inlinevirtual
virtual void TMPro.TMP_InputField.OnUpdateSelected ( BaseEventData  eventData)
inlinevirtual

Parameters
eventData
delegate char TMPro.TMP_InputField.OnValidateInput ( string  text,
int  charIndex,
char  addedChar 
)
void TMPro.TMP_InputField.ProcessEvent ( Event  e)
inline
virtual void TMPro.TMP_InputField.Rebuild ( CanvasUpdate  update)
inlinevirtual
void TMPro.TMP_InputField.SelectAll ( )
inlineprotected
void TMPro.TMP_InputField.SendOnEndEdit ( )
inlineprotected

Submit the input field's text.

void TMPro.TMP_InputField.SendOnEndTextSelection ( )
inlineprotected
void TMPro.TMP_InputField.SendOnFocus ( )
inlineprotected
void TMPro.TMP_InputField.SendOnFocusLost ( )
inlineprotected
void TMPro.TMP_InputField.SendOnSubmit ( )
inlineprotected
void TMPro.TMP_InputField.SendOnTextSelection ( )
inlineprotected
void TMPro.TMP_InputField.SetGlobalFontAsset ( TMP_FontAsset  fontAsset)
inline

Function to conveniently set the Font Asset of both Placeholder and Input Field text object.

Parameters
fontAsset
void TMPro.TMP_InputField.SetGlobalPointSize ( float  pointSize)
inline

Function to conveniently set the point size of both Placeholder and Input Field text object.

Parameters
pointSize
void TMPro.TMP_InputField.UpdateLabel ( )
inlineprotected

Update the visual text Text.

char TMPro.TMP_InputField.Validate ( string  text,
int  pos,
char  ch 
)
inlineprotected

Validate the specified input.

Member Data Documentation

int TMPro.TMP_InputField.m_CaretPosition = 0
protected
int TMPro.TMP_InputField.m_CaretSelectPosition = 0
protected
bool TMPro.TMP_InputField.m_CaretVisible
protected
UIVertex [] TMPro.TMP_InputField.m_CursorVerts = null
protected
TMP_FontAsset TMPro.TMP_InputField.m_GlobalFontAsset
protected
TMP_InputValidator TMPro.TMP_InputField.m_InputValidator = null
protected
bool TMPro.TMP_InputField.m_isRichTextEditingAllowed = true
protected
bool TMPro.TMP_InputField.m_isSelectAll
protected
TouchScreenKeyboard TMPro.TMP_InputField.m_Keyboard
protected
Mesh TMPro.TMP_InputField.m_Mesh
protected
bool TMPro.TMP_InputField.m_OnFocusSelectAll = true
protected
Graphic TMPro.TMP_InputField.m_Placeholder
protected
bool TMPro.TMP_InputField.m_ResetOnDeActivation = true
protected
float TMPro.TMP_InputField.m_ScrollSensitivity = 1.0f
protected

int TMPro.TMP_InputField.m_StringPosition = 0
protected
int TMPro.TMP_InputField.m_StringSelectPosition = 0
protected
string TMPro.TMP_InputField.m_Text = string.Empty
protected

Input field's value.

TMP_Text TMPro.TMP_InputField.m_TextComponent
protected
RectTransform TMPro.TMP_InputField.m_TextComponentRectTransform
protected
RectTransform TMPro.TMP_InputField.m_TextViewport
protected

Text Text used to display the input's value.

Scrollbar TMPro.TMP_InputField.m_VerticalScrollbar
protected
TMP_ScrollbarEventHandler TMPro.TMP_InputField.m_VerticalScrollbarEventHandler
protected

Property Documentation

char TMPro.TMP_InputField.asteriskChar
getset
float TMPro.TMP_InputField.caretBlinkRate
getset
Color TMPro.TMP_InputField.caretColor
getset
int TMPro.TMP_InputField.caretPosition
getset

Get: Returns the focus position as thats the position that moves around even during selection. Set: Set both the anchor and focus position such that a selection doesn't happen

int TMPro.TMP_InputField.caretPositionInternal
getsetprotected

Current position of the cursor. Getters are public Setters are protected

int TMPro.TMP_InputField.caretSelectPositionInternal
getsetprotected
int TMPro.TMP_InputField.caretWidth
getset
int TMPro.TMP_InputField.characterLimit
getset
CharacterValidation TMPro.TMP_InputField.characterValidation
getset
ContentType TMPro.TMP_InputField.contentType
getset
bool TMPro.TMP_InputField.customCaretColor
getset
TMP_FontAsset TMPro.TMP_InputField.fontAsset
getset

Sets the Font Asset on both Placeholder and Input child objects.

InputType TMPro.TMP_InputField.inputType
getset
TMP_InputValidator TMPro.TMP_InputField.inputValidator
getset

Sets the Input Validation to use a Custom Input Validation script.

bool TMPro.TMP_InputField.isFocused
get
bool TMPro.TMP_InputField.isRichTextEditingAllowed
getset

Is Rich Text editing allowed?

TouchScreenKeyboardType TMPro.TMP_InputField.keyboardType
getset
LineType TMPro.TMP_InputField.lineType
getset
Mesh TMPro.TMP_InputField.mesh
getprotected
bool TMPro.TMP_InputField.multiLine
get
SelectionEvent TMPro.TMP_InputField.onDeselect
getset
SubmitEvent TMPro.TMP_InputField.onEndEdit
getset
TextSelectionEvent TMPro.TMP_InputField.onEndTextSelection
getset
bool TMPro.TMP_InputField.onFocusSelectAll
getset

Determines if the whole text will be selected when focused.

SelectionEvent TMPro.TMP_InputField.onSelect
getset
SubmitEvent TMPro.TMP_InputField.onSubmit
getset
TextSelectionEvent TMPro.TMP_InputField.onTextSelection
getset
OnValidateInput TMPro.TMP_InputField.onValidateInput
getset
OnChangeEvent TMPro.TMP_InputField.onValueChanged
getset
Graphic TMPro.TMP_InputField.placeholder
getset
float TMPro.TMP_InputField.pointSize
getset

Set the point size on both Placeholder and Input text object.

bool TMPro.TMP_InputField.readOnly
getset
bool TMPro.TMP_InputField.resetOnDeActivation
getset

Determines if the text and caret position as well as selection will be reset when the input field is deactivated.

bool TMPro.TMP_InputField.restoreOriginalTextOnEscape
getset

Controls whether the original text is restored when pressing "ESC".

bool TMPro.TMP_InputField.richText
getset
float TMPro.TMP_InputField.scrollSensitivity
getset
int TMPro.TMP_InputField.selectionAnchorPosition
getset

Get: Returns the fixed position of selection Set: If Input.compositionString is 0 set the fixed position

Color TMPro.TMP_InputField.selectionColor
getset
int TMPro.TMP_InputField.selectionFocusPosition
getset

Get: Returns the variable position of selection Set: If Input.compositionString is 0 set the variable position

int TMPro.TMP_InputField.selectionStringAnchorPosition
getset

The fixed position of the selection in the raw string which may contains rich text.

int TMPro.TMP_InputField.selectionStringFocusPosition
getset

The variable position of the selection in the raw string which may contains rich text.

bool TMPro.TMP_InputField.shouldHideMobileInput
getset

Should the mobile keyboard input be hidden.

int TMPro.TMP_InputField.stringPosition
getset

int TMPro.TMP_InputField.stringPositionInternal
getsetprotected
int TMPro.TMP_InputField.stringSelectPositionInternal
getsetprotected
string TMPro.TMP_InputField.text
getset

Input field's current text value.

TMP_Text TMPro.TMP_InputField.textComponent
getset
RectTransform TMPro.TMP_InputField.textViewport
getset
Scrollbar TMPro.TMP_InputField.verticalScrollbar
getset
bool TMPro.TMP_InputField.wasCanceled
get

The documentation for this class was generated from the following file: