A class in Root.Township, Alta.Meta.UI.
A text input field in the game's world-space menus, showing its text through a TextRenderer with an optional caret and secret (password) mode.
Constructors
| Member | What it is |
|---|
InputField() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
| Member | What it is |
|---|
bool isSecret | Whether the text is shown masked with *. |
5 private and internal fields
| Member | What it is |
|---|
private Transform caret | The caret transform set by SetupCaret, or null when the caret is off. |
private string inputText | Serialized copy of the text, kept in step with InputText and used when toggling secret mode. |
private int maxLength | Display length before the text is cut with "...". -1 means no limit. Doesn't limit what can be typed. |
private UnityEvent onSubmit | Inspector event invoked by OnSubmit. |
private TextRenderer textVisuals | Text renderer that shows the text, or asterisks in secret mode. |
Properties
| Member | What it is |
|---|
string InputText { get; private set; } | The field's current text (the real value, not the masked display). |
Events
| Member | What it is |
|---|
event Action<InputField> InputChanged | Raised whenever the text is set to something new. |
event Action<InputField> Submitted | Raised when the field is submitted. |
Methods
| Member | What it is |
|---|
void DisableCaret() | Stops moving the caret with the text. |
void OnSubmit() | Raises Submitted and the inspector's submit event. |
void SetText(string newText) | Sets the text and updates the display (masked with * if secret, cut to the max length otherwise). |
void SetText(string newText, bool toggleSecret) | Sets the text and updates the display (masked with * if secret, cut to the max length otherwise). |
void SetupCaret(Transform caret) | Attaches a caret transform that follows the end of the text. |
void ToggleSecret() | Flips secret mode and redraws the text. |
1 private and internal method
| Member | What it is |
|---|
private void UpdateCaret() | Moves the caret to the end of the current line of text, or the text start when empty. |
Used in
Members of other types that take, return or hold a InputField:
InputFieldWithKeyboard.inputField, InputFieldWithKeyboard.InputField, FriendsListPanel.AddFriend, FriendsListPanel.friendSearch, GroupMembersPage.HandleInvitePressed, GroupMembersPage.inviteField, ServerDetailsPanel.descriptionInput, ServerDetailsPanel.nameInput, ServerDetailsPanel.UpdateSummary, AccountNameTextReplacer.UpdateFromInput, AltaAccountRegistererAndLinker.confirmPasswordInput, AltaAccountRegistererAndLinker.emailInput, EmailVerificationManager.emailInput, LoginAndRegisterHelper.passwordInput, LoginAndRegisterHelper.usernameInput, RuntimeConsole.OnInputSubmitted.