Control that provides single-line string editing.
LineEdit provides a single-line string editor, used for text fields. It features many built-in shortcuts which will always be available:
- Ctrl + C: Copy
- Ctrl + X: Cut
- Ctrl + V or Ctrl + Y: Paste/"yank"
- Ctrl + Z: Undo
- Ctrl + Shift + Z: Redo
- Ctrl + U: Delete text from the cursor position to the beginning of the line
- Ctrl + K: Delete text from the cursor position to the end of the line
- Ctrl + A: Select all text
- Up/Down arrow: Move the cursor to the beginning/end of the line
Adds [code]text[/code] after the cursor. If the resulting value is longer than [member max_length], nothing happens.
Erases the [code]LineEdit[/code] text.
Clears the current selection.
Returns the [PopupMenu] of this [code]LineEdit[/code]. By default, this menu is displayed when right-clicking on the [code]LineEdit[/code].
Executes a given action as defined in the MENU_* enum.
Selects characters inside [code]LineEdit[/code] between [code]from[/code] and [code]to[/code]. By default [code]from[/code] is at the beginning and [code]to[/code] at the end.
[codeblock]
text = "Welcome"
select() # Welcome
select(4) # ome
select(2, 5) # lco
[/codeblock]
Selects the whole [String].
Text alignment as defined in the ALIGN_* enum.
If [code]true[/code], the caret (visual cursor) blinks.
Duration (in seconds) of a caret's blinking cycle.
The cursor's position inside the [code]LineEdit[/code]. When set, the text may scroll to accommodate it.
If [code]true[/code], the [code]LineEdit[/code] will show a clear button if [code]text[/code] is not empty.
If [code]true[/code], the context menu will appear when right clicked.
If [code]false[/code], existing text cannot be modified and new text cannot be added.
If [code]true[/code], the [code]LineEdit[/code] width will increase to stay longer than the [member text]. It will [b]not[/b] compress if the [member text] is shortened.
Defines how the [code]LineEdit[/code] can grab focus (Keyboard and mouse, only keyboard, or none). See [code]enum FocusMode[/code] in [Control] for details.
Maximum amount of characters that can be entered inside the [code]LineEdit[/code]. If [code]0[/code], there is no limit.
Opacity of the [member placeholder_text]. From [code]0[/code] to [code]1[/code].
Text shown when the [code]LineEdit[/code] is empty. It is [b]not[/b] the [code]LineEdit[/code]'s default value (see [member text]).
If [code]true[/code], every character is replaced with the secret character (see [member secret_character]).
The character to use to mask secret input (defaults to "*"). Only a single character can be used as the secret character.
String value of the [code]LineEdit[/code].
Emitted when the text changes.
Emitted when the user presses [code]KEY_ENTER[/code] on the [code]LineEdit[/code].
Aligns the text on the left hand side of the [code]LineEdit[/code].
Centers the text in the middle of the [code]LineEdit[/code].
Aligns the text on the right hand side of the [code]LineEdit[/code].
Stretches whitespaces to fit the [code]LineEdit[/code]'s width.
Cuts (copies and clears) the selected text.
Copies the selected text.
Pastes the clipboard text over the selected text (or at the cursor's position).
Erases the whole [code]LineEdit[/code] text.
Selects the whole [code]LineEdit[/code] text.
Undoes the previous action.
Reverse the last undo action.