Index · Object → Node → CanvasItem → Control → LineEdit

LineEdit

An input field for single-line text.

Class Description

LineEdit provides an input field for editing a single line of text.

- When the LineEdit control is focused using the keyboard arrow keys, it will only gain focus and not enter edit mode.

- To enter edit mode, click on the control with the mouse, see also keep_editing_on_text_submit.

- To exit edit mode, press ui_text_submit or ui_cancel (by default Escape) actions.

- Check edit(), unedit(), is_editing(), and editing_toggled for more information.

While entering text, it is possible to insert special characters using Unicode, OEM or Windows alt codes:

- To enter Unicode codepoints, hold Alt and type the codepoint on the numpad. For example, to enter the character á (U+00E1), hold Alt and type +E1 on the numpad (the leading zeroes can be omitted).

- To enter OEM codepoints, hold Alt and type the code on the numpad. For example, to enter the character á (OEM 160), hold Alt and type 160 on the numpad.

- To enter Windows codepoints, hold Alt and type the code on the numpad. For example, to enter the character á (Windows 0225), hold Alt and type 0, 2, 2, 5 on the numpad. The leading zero here must not be omitted, as this is how Windows codepoints are distinguished from OEM codepoints.

Important:

- Focusing the LineEdit with ui_focus_next (by default Tab) or ui_focus_prev (by default Shift + Tab) or Control.grab_focus() still enters edit mode (for compatibility).

LineEdit features many built-in shortcuts that are always available (Ctrl here maps to Cmd on macOS):

- Ctrl + C: Copy

- Ctrl + X: Cut

- Ctrl + V or Ctrl + Y: Paste/"yank"

- Ctrl + Z: Undo

- Ctrl + ~: Swap input direction.

- Ctrl + Shift + Z: Redo

- Ctrl + U: Delete text from the caret position to the beginning of the line

- Ctrl + K: Delete text from the caret position to the end of the line

- Ctrl + A: Select all text

- Up Arrow/Down Arrow: Move the caret to the beginning/end of the line

On macOS, some extra keyboard shortcuts are available:

- Cmd + F: Same as Right Arrow, move the caret one character right

- Cmd + B: Same as Left Arrow, move the caret one character left

- Cmd + P: Same as Up Arrow, move the caret to the previous line

- Cmd + N: Same as Down Arrow, move the caret to the next line

- Cmd + D: Same as Delete, delete the character on the right side of caret

- Cmd + H: Same as Backspace, delete the character on the left side of the caret

- Cmd + A: Same as Home, move the caret to the beginning of the line

- Cmd + E: Same as End, move the caret to the end of the line

- Cmd + Left Arrow: Same as Home, move the caret to the beginning of the line

- Cmd + Right Arrow: Same as End, move the caret to the end of the line

Note: Caret movement shortcuts listed above are not affected by shortcut_keys_enabled.

Properties

var alignment: HorizontalAlignment = 0

The text's horizontal alignment.

var backspace_deletes_composite_character_enabled: bool = false

If true and caret_mid_grapheme is false, backspace deletes an entire composite character such as ❤️‍🩹, instead of deleting part of the composite character.

var caret_column: int = 0

The caret's column position inside the LineEdit. When set, the text may scroll to accommodate it.

var caret_force_displayed: bool = false

If true, the LineEdit will always show the caret, even if not editing or focus is lost.

var caret_mid_grapheme: bool = false

Allow moving caret, selecting and removing the individual composite character components.

Note: Backspace is always removing individual composite character components.

var clear_button_enabled: bool = false

If true, the LineEdit will show a clear button if text is not empty, which can be used to clear the text quickly.

var context_menu_enabled: bool = true

If true, the context menu will appear when right-clicked.

var deselect_on_focus_loss_enabled: bool = true

If true, the selected text will be deselected when focus is lost.

var drag_and_drop_selection_enabled: bool = true

If true, allow drag and drop of selected text.

var draw_control_chars: bool = false

If true, control characters are displayed.

var editable: bool = true

If false, existing text cannot be modified and new text cannot be added.

var emoji_menu_enabled: bool = true

If true, "Emoji and Symbols" menu is enabled.

var expand_to_text_length: bool = false

If true, the LineEdit width will increase to stay longer than the text. It will not compress if the text is shortened.

var flat: bool = false

If true, the LineEdit doesn't display decoration.

var focus_mode: Control.FocusMode = 2
var icon_expand_mode: LineEdit.ExpandMode = 0

Define the scaling behavior of the right_icon.

var keep_editing_on_text_submit: bool = false

If true, the LineEdit will not exit edit mode when text is submitted by pressing ui_text_submit action (by default: Enter or Kp Enter).

var language: String = ""

Language code used for line-breaking and text shaping algorithms. If left empty, the current locale is used instead.

var max_length: int = 0

Maximum number of characters that can be entered inside the LineEdit. If 0, there is no limit.

When a limit is defined, characters that would exceed max_length are truncated. This happens both for existing text contents when setting the max length, or for new text inserted in the LineEdit, including pasting.

If any input text is truncated, the text_change_rejected signal is emitted with the truncated substring as a parameter:

text = "Hello world"
max_length = 5
# `text` becomes "Hello".
max_length = 10
text += " goodbye"
# `text` becomes "Hello good".
# `text_change_rejected` is emitted with "bye" as a parameter.
var middle_mouse_paste_enabled: bool = true

If false, using middle mouse button to paste clipboard will be disabled.

Note: This method is only implemented on Linux.

var mouse_default_cursor_shape: Control.CursorShape = 1
var placeholder_text: String = ""

Text shown when the LineEdit is empty. It is not the LineEdit's default value (see text).

var right_icon: Texture2D

Sets the icon that will appear in the right end of the LineEdit if there's no text, or always, if clear_button_enabled is set to false.

var right_icon_scale: float = 1.0

Scale ratio of the icon when icon_expand_mode is set to EXPAND_MODE_FIT_TO_LINE_EDIT.

var secret: bool = false

If true, every character is replaced with the secret character (see secret_character).

var secret_character: String = "•"

The character to use to mask secret input. Only a single character can be used as the secret character. If it is longer than one character, only the first one will be used. If it is empty, a space will be used instead.

var select_all_on_focus: bool = false

If true, the LineEdit will select the whole text when it gains focus.

var selecting_enabled: bool = true

If false, it's impossible to select the text using mouse nor keyboard.

var shortcut_keys_enabled: bool = true

If true, shortcut keys for context menu items are enabled, even if the context menu is disabled.

var structured_text_bidi_override: TextServer.StructuredTextParser = 0

Set BiDi algorithm override for the structured text.

var structured_text_bidi_override_options: Array = []

Set additional options for BiDi override.

var text: String = ""

String value of the LineEdit.

Note: Changing text using this property won't emit the text_changed signal.

var text_direction: Control.TextDirection = 0

Base text writing direction.

var virtual_keyboard_enabled: bool = true

If true, the native virtual keyboard is enabled on platforms that support it.

var virtual_keyboard_show_on_focus: bool = true

If true, the native virtual keyboard is shown on focus events on platforms that support it.

var virtual_keyboard_type: LineEdit.VirtualKeyboardType = 0

Specifies the type of virtual keyboard to show.

Inherited from Control (62)
var accessibility_controls_nodes: NodePath[] = []
var accessibility_flow_to_nodes: NodePath[] = []
var accessibility_labeled_by_nodes: NodePath[] = []
var anchor_bottom: float = 0.0
var anchor_left: float = 0.0
var anchor_right: float = 0.0
var anchor_top: float = 0.0
var clip_contents: bool = false
var custom_maximum_size: Vector2 = Vector2(-1, -1)
var custom_minimum_size: Vector2 = Vector2(0, 0)
var focus_neighbor_bottom: NodePath = NodePath("")
var focus_neighbor_left: NodePath = NodePath("")
var focus_neighbor_right: NodePath = NodePath("")
var focus_neighbor_top: NodePath = NodePath("")
var focus_next: NodePath = NodePath("")
var focus_previous: NodePath = NodePath("")
var offset_bottom: float = 0.0
var offset_left: float = 0.0
var offset_right: float = 0.0
var offset_top: float = 0.0
var offset_transform_pivot: Vector2 = Vector2(0, 0)
var offset_transform_pivot_ratio: Vector2 = Vector2(0.5, 0.5)
var offset_transform_position: Vector2 = Vector2(0, 0)
var offset_transform_scale: Vector2 = Vector2(1, 1)
var pivot_offset: Vector2 = Vector2(0, 0)
var pivot_offset_ratio: Vector2 = Vector2(0, 0)
var position: Vector2 = Vector2(0, 0)
var rotation: float = 0.0
var scale: Vector2 = Vector2(1, 1)
var size: Vector2 = Vector2(0, 0)
Inherited from CanvasItem (16)
var light_mask: int = 1
var modulate: Color = Color(1, 1, 1, 1)
var self_modulate: Color = Color(1, 1, 1, 1)
var top_level: bool = false
var visible: bool = true
var y_sort_enabled: bool = false
var z_as_relative: bool = true
var z_index: int = 0
Inherited from Node (14)
var owner: Node

Methods

func apply_ime() -> void

Applies text from the Input Method Editor (IME) and closes the IME if it is open.

func cancel_ime() -> void

Closes the Input Method Editor (IME) if it is open. Any text in the IME will be lost.

func clear() -> void

Erases the LineEdit's text.

func delete_char_at_caret() -> void

Deletes one character at the caret's current position (equivalent to pressing Delete).

func delete_text(from_column: int, to_column: int) -> void

Deletes a section of the text going from position from_column to to_column. Both parameters should be within the text's length.

func deselect() -> void

Clears the current selection.

func edit(hide_focus: bool = false) -> void

Allows entering edit mode whether the LineEdit is focused or not. If hide_focus is true, the focused state will not be shown (see Control.grab_focus()).

See also keep_editing_on_text_submit.

func get_menu() -> PopupMenu

Returns the PopupMenu of this LineEdit. By default, this menu is displayed when right-clicking on the LineEdit.

You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see MenuItems). For example:

func _ready():
	var menu = get_menu()
	# Remove all items after "Redo".
	menu.item_count = menu.get_item_index(MENU_REDO) + 1
	# Add custom items.
	menu.add_separator()
	menu.add_item("Insert Date", MENU_MAX + 1)
	# Connect callback.
	menu.id_pressed.connect(_on_item_pressed)

func _on_item_pressed(id):
	if id == MENU_MAX + 1:
		insert_text_at_caret(Time.get_date_string_from_system())

Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their Window.visible property.

func get_next_composite_character_column(column: int) -> int

Returns the correct column at the end of a composite character like ❤️‍🩹 (mending heart; Unicode: U+2764 U+FE0F U+200D U+1FA79) which is comprised of more than one Unicode code point, if the caret is at the start of the composite character. Also returns the correct column with the caret at mid grapheme and for non-composite characters.

Note: To check at caret location use get_next_composite_character_column(get_caret_column())

func get_previous_composite_character_column(column: int) -> int

Returns the correct column at the start of a composite character like ❤️‍🩹 (mending heart; Unicode: U+2764 U+FE0F U+200D U+1FA79) which is comprised of more than one Unicode code point, if the caret is at the end of the composite character. Also returns the correct column with the caret at mid grapheme and for non-composite characters.

Note: To check at caret location use get_previous_composite_character_column(get_caret_column())

func get_scroll_offset() -> float

Returns the scroll offset due to caret_column, as a number of characters.

func get_selected_text() -> String

Returns the text inside the selection.

func get_selection_from_column() -> int

Returns the selection begin column.

func get_selection_to_column() -> int

Returns the selection end column.

func has_ime_text() -> bool

Returns true if the user has text in the Input Method Editor (IME).

func has_redo() -> bool

Returns true if a "redo" action is available.

func has_selection() -> bool

Returns true if the user has selected text.

func has_undo() -> bool

Returns true if an "undo" action is available.

func insert_text_at_caret(text: String) -> void

Inserts text at the caret. If the resulting value is longer than max_length, nothing happens.

func is_editing() -> bool

Returns whether the LineEdit is being edited.

func is_menu_visible() -> bool

Returns whether the menu is visible. Use this instead of get_menu().visible to improve performance (so the creation of the menu is avoided).

func menu_option(option: int) -> void

Executes a given action as defined in the MenuItems enum.

func select(from: int = 0, to: int = -1) -> void

Selects characters inside LineEdit between from and to. By default, from is at the beginning and to at the end.

text = "Welcome"
select() # Will select "Welcome".
select(4) # Will select "ome".
select(2, 5) # Will select "lco".
func select_all() -> void

Selects the whole String.

func unedit() -> void

Allows exiting edit mode while preserving focus.

Inherited from Control (100)
func _can_drop_data(at_position: Vector2, data: Variant) -> bool
func _drop_data(at_position: Vector2, data: Variant) -> void
func _get_cursor_shape(at_position: Vector2) -> int
func _get_drag_data(at_position: Vector2) -> Variant
func _get_tooltip(at_position: Vector2) -> String
func _gui_input(event: InputEvent) -> void
func _has_point(point: Vector2) -> bool
func _structured_text_parser(args: Array, text: String) -> Vector3i[]
func accept_event() -> void
func accessibility_drag() -> void
func accessibility_drop() -> void
func add_theme_color_override(name: StringName, color: Color) -> void
func add_theme_constant_override(name: StringName, constant: int) -> void
func add_theme_font_override(name: StringName, font: Font) -> void
func add_theme_font_size_override(name: StringName, font_size: int) -> void
func add_theme_icon_override(name: StringName, texture: Texture2D) -> void
func add_theme_stylebox_override(name: StringName, stylebox: StyleBox) -> void
func force_drag(data: Variant, preview: Control) -> void
func get_anchor(side: Side) -> float
func get_begin() -> Vector2
func get_cursor_shape(at_position: Vector2 = Vector2(0, 0)) -> Control.CursorShape
func get_end() -> Vector2
func get_focus_neighbor(side: Side) -> NodePath
func get_offset(offset: Side) -> float
func get_rect() -> Rect2
func get_theme_color(name: StringName, theme_type: StringName = &"") -> Color
func get_theme_constant(name: StringName, theme_type: StringName = &"") -> int
func get_theme_font(name: StringName, theme_type: StringName = &"") -> Font
func get_theme_font_size(name: StringName, theme_type: StringName = &"") -> int
func get_theme_icon(name: StringName, theme_type: StringName = &"") -> Texture2D
func get_theme_stylebox(name: StringName, theme_type: StringName = &"") -> StyleBox
func get_tooltip(at_position: Vector2 = Vector2(0, 0)) -> String
func grab_click_focus() -> void
func grab_focus(hide_focus: bool = false) -> void
func has_focus(ignore_hidden_focus: bool = false) -> bool
func has_theme_color(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_constant(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_font(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_font_size(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_icon(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_stylebox(name: StringName, theme_type: StringName = &"") -> bool
func release_focus() -> void
func reset_size() -> void
func set_anchor(side: Side, anchor: float, keep_offset: bool = false, push_opposite_anchor: bool = true) -> void
func set_anchor_and_offset(side: Side, anchor: float, offset: float, push_opposite_anchor: bool = false) -> void
func set_anchors_and_offsets_preset(preset: Control.LayoutPreset, resize_mode: Control.LayoutPresetMode = 0, margin: int = 0) -> void
func set_anchors_preset(preset: Control.LayoutPreset, keep_offsets: bool = false) -> void
func set_begin(position: Vector2) -> void
func set_drag_forwarding(drag_func: Callable, can_drop_func: Callable, drop_func: Callable) -> void
func set_drag_preview(control: Control) -> void
func set_end(position: Vector2) -> void
func set_focus_neighbor(side: Side, neighbor: NodePath) -> void
func set_global_position(position: Vector2, keep_offsets: bool = false) -> void
func set_offset(side: Side, offset: float) -> void
func set_offsets_preset(preset: Control.LayoutPreset, resize_mode: Control.LayoutPresetMode = 0, margin: int = 0) -> void
func set_position(position: Vector2, keep_offsets: bool = false) -> void
func set_size(size: Vector2, keep_offsets: bool = false) -> void
func update_maximum_size() -> void
func update_minimum_size() -> void
func warp_mouse(position: Vector2) -> void
Inherited from CanvasItem (62)
func _draw() -> void
func draw_animation_slice(animation_length: float, slice_begin: float, slice_end: float, offset: float = 0.0) -> void
func draw_arc(center: Vector2, radius: float, start_angle: float, end_angle: float, point_count: int, color: Color, width: float = -1.0, antialiased: bool = false) -> void
func draw_char(font: Font, pos: Vector2, char: String, font_size: int = 16, modulate: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) -> void
func draw_char_outline(font: Font, pos: Vector2, char: String, font_size: int = 16, size: int = -1, modulate: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) -> void
func draw_circle(position: Vector2, radius: float, color: Color, filled: bool = true, width: float = -1.0, antialiased: bool = false) -> void
func draw_colored_polygon(points: PackedVector2Array, color: Color, uvs: PackedVector2Array = PackedVector2Array(), texture: Texture2D = null) -> void
func draw_dashed_line(from: Vector2, to: Vector2, color: Color, width: float = -1.0, dash: float = 2.0, aligned: bool = true, antialiased: bool = false) -> void
func draw_ellipse(position: Vector2, major: float, minor: float, color: Color, filled: bool = true, width: float = -1.0, antialiased: bool = false) -> void
func draw_ellipse_arc(center: Vector2, major: float, minor: float, start_angle: float, end_angle: float, point_count: int, color: Color, width: float = -1.0, antialiased: bool = false) -> void
func draw_end_animation() -> void
func draw_lcd_texture_rect_region(texture: Texture2D, rect: Rect2, src_rect: Rect2, modulate: Color = Color(1, 1, 1, 1)) -> void
func draw_line(from: Vector2, to: Vector2, color: Color, width: float = -1.0, antialiased: bool = false) -> void
func draw_mesh(mesh: Mesh, texture: Texture2D, transform: Transform2D = Transform2D(1, 0, 0, 1, 0, 0), modulate: Color = Color(1, 1, 1, 1)) -> void
func draw_msdf_texture_rect_region(texture: Texture2D, rect: Rect2, src_rect: Rect2, modulate: Color = Color(1, 1, 1, 1), outline: float = 0.0, pixel_range: float = 4.0, scale: float = 1.0) -> void
func draw_multiline(points: PackedVector2Array, color: Color, width: float = -1.0, antialiased: bool = false) -> void
func draw_multiline_colors(points: PackedVector2Array, colors: PackedColorArray, width: float = -1.0, antialiased: bool = false) -> void
func draw_multiline_string(font: Font, pos: Vector2, text: String, alignment: HorizontalAlignment = 0, width: float = -1, font_size: int = 16, max_lines: int = -1, modulate: Color = Color(1, 1, 1, 1), brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0, oversampling: float = 0.0) -> void
func draw_multiline_string_outline(font: Font, pos: Vector2, text: String, alignment: HorizontalAlignment = 0, width: float = -1, font_size: int = 16, max_lines: int = -1, size: int = 1, modulate: Color = Color(1, 1, 1, 1), brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0, oversampling: float = 0.0) -> void
func draw_multimesh(multimesh: MultiMesh, texture: Texture2D) -> void
func draw_polygon(points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array = PackedVector2Array(), texture: Texture2D = null) -> void
func draw_polyline(points: PackedVector2Array, color: Color, width: float = -1.0, antialiased: bool = false) -> void
func draw_polyline_colors(points: PackedVector2Array, colors: PackedColorArray, width: float = -1.0, antialiased: bool = false) -> void
func draw_primitive(points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array, texture: Texture2D = null) -> void
func draw_rect(rect: Rect2, color: Color, filled: bool = true, width: float = -1.0, antialiased: bool = false) -> void
func draw_set_transform(position: Vector2, rotation: float = 0.0, scale: Vector2 = Vector2(1, 1)) -> void
func draw_string(font: Font, pos: Vector2, text: String, alignment: HorizontalAlignment = 0, width: float = -1, font_size: int = 16, modulate: Color = Color(1, 1, 1, 1), justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0, oversampling: float = 0.0) -> void
func draw_string_outline(font: Font, pos: Vector2, text: String, alignment: HorizontalAlignment = 0, width: float = -1, font_size: int = 16, size: int = 1, modulate: Color = Color(1, 1, 1, 1), justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0, oversampling: float = 0.0) -> void
func draw_style_box(style_box: StyleBox, rect: Rect2) -> void
func draw_texture(texture: Texture2D, position: Vector2, modulate: Color = Color(1, 1, 1, 1)) -> void
func draw_texture_rect(texture: Texture2D, rect: Rect2, tile: bool, modulate: Color = Color(1, 1, 1, 1), transpose: bool = false) -> void
func draw_texture_rect_region(texture: Texture2D, rect: Rect2, src_rect: Rect2, modulate: Color = Color(1, 1, 1, 1), transpose: bool = false, clip_uv: bool = true) -> void
func force_update_transform() -> void
func get_canvas() -> RID
func hide() -> void
func make_canvas_position_local(viewport_point: Vector2) -> Vector2
func move_to_front() -> void
func queue_redraw() -> void
func set_notify_local_transform(enable: bool) -> void
func set_notify_transform(enable: bool) -> void
func set_visibility_layer_bit(layer: int, enabled: bool) -> void
func show() -> void
Inherited from Node (106)
func _enter_tree() -> void
func _exit_tree() -> void
func _input(event: InputEvent) -> void
func _physics_process(delta: float) -> void
func _process(delta: float) -> void
func _ready() -> void
func _shortcut_input(event: InputEvent) -> void
func _unhandled_input(event: InputEvent) -> void
func _unhandled_key_input(event: InputEvent) -> void
func add_child(node: Node, force_readable_name: bool = false, internal: Node.InternalMode = 0) -> void
func add_sibling(sibling: Node, force_readable_name: bool = false) -> void
func add_to_group(group: StringName, persistent: bool = false) -> void
func atr(message: String, context: StringName = "") -> String
func atr_n(message: String, plural_message: StringName, n: int, context: StringName = "") -> String
func can_process() -> bool
func duplicate(flags: int = 15) -> Node
func find_child(pattern: String, recursive: bool = true, owned: bool = true) -> Node
func find_children(pattern: String, type: String = "", recursive: bool = true, owned: bool = true) -> Node[]
func find_parent(pattern: String) -> Node
func get_child(idx: int, include_internal: bool = false) -> Node
func get_child_count(include_internal: bool = false) -> int
func get_children(include_internal: bool = false) -> Node[]
func get_groups() -> StringName[]
func get_index(include_internal: bool = false) -> int
func get_node(path: NodePath) -> Node
func get_orphan_node_ids() -> int[]
func get_parent() -> Node
func get_path() -> NodePath
func get_path_to(node: Node, use_unique_path: bool = false) -> NodePath
func get_window() -> Window
func has_node(path: NodePath) -> bool
func is_ancestor_of(node: Node) -> bool
func is_greater_than(node: Node) -> bool
func is_in_group(group: StringName) -> bool
func move_child(child_node: Node, to_index: int) -> void
func notify_deferred_thread_group(what: int) -> void
func notify_thread_safe(what: int) -> void
func print_orphan_nodes() -> void
func print_tree() -> void
func print_tree_pretty() -> void
func propagate_call(method: StringName, args: Array = [], parent_first: bool = false) -> void
func propagate_notification(what: int) -> void
func queue_free() -> void
func remove_child(node: Node) -> void
func remove_from_group(group: StringName) -> void
func reparent(new_parent: Node, keep_global_transform: bool = true) -> void
func replace_by(node: Node, keep_groups: bool = false) -> void
func request_ready() -> void
func rpc(method: StringName) -> Error
func rpc_config(method: StringName, config: Variant) -> void
func rpc_id(peer_id: int, method: StringName) -> Error
func set_deferred_thread_group(property: StringName, value: Variant) -> void
func set_display_folded(fold: bool) -> void
func set_editable_instance(node: Node, is_editable: bool) -> void
func set_multiplayer_authority(id: int, recursive: bool = true) -> void
func set_physics_process(enable: bool) -> void
func set_physics_process_internal(enable: bool) -> void
func set_process(enable: bool) -> void
func set_process_input(enable: bool) -> void
func set_process_internal(enable: bool) -> void
func set_process_shortcut_input(enable: bool) -> void
func set_process_unhandled_input(enable: bool) -> void
func set_scene_instance_load_placeholder(load_placeholder: bool) -> void
func set_thread_safe(property: StringName, value: Variant) -> void
Inherited from Object (62)
func _get(property: StringName) -> Variant
func _get_property_list() -> Dictionary[]
func _init() -> void
func _iter_get(iter: Variant) -> Variant
func _iter_init(iter: Array) -> bool
func _iter_next(iter: Array) -> bool
func _notification(what: int) -> void
func _set(property: StringName, value: Variant) -> bool
func _to_string() -> String
func _validate_property(property: Dictionary) -> void
func add_user_signal(signal: String, arguments: Array = []) -> void
func call(method: StringName) -> Variant
func callv(method: StringName, arg_array: Array) -> Variant
func cancel_free() -> void
func connect(signal: StringName, callable: Callable, flags: int = 0) -> Error
func disconnect(signal: StringName, callable: Callable) -> void
func emit_signal(signal: StringName) -> Error
func free() -> void
func get(property: StringName) -> Variant
func get_class() -> String
func get_incoming_connections() -> Dictionary[]
func get_indexed(property_path: NodePath) -> Variant
func get_meta(name: StringName, default: Variant = null) -> Variant
func get_meta_list() -> StringName[]
func get_method_list() -> Dictionary[]
func get_property_list() -> Dictionary[]
func get_signal_connection_list(signal: StringName) -> Dictionary[]
func get_signal_list() -> Dictionary[]
func has_meta(name: StringName) -> bool
func has_method(method: StringName) -> bool
func has_signal(signal: StringName) -> bool
func is_class(class: StringName) -> bool
func is_connected(signal: StringName, callable: Callable) -> bool
func notification(what: int, reversed: bool = false) -> void
func remove_meta(name: StringName) -> void
func remove_user_signal(signal: StringName) -> void
func set(property: StringName, value: Variant) -> void
func set_block_signals(enable: bool) -> void
func set_deferred(property: StringName, value: Variant) -> void
func set_indexed(property_path: NodePath, value: Variant) -> void
func set_message_translation(enable: bool) -> void
func set_meta(name: StringName, value: Variant) -> void
func set_script(script: Variant) -> void
func set_translation_domain(domain: StringName) -> void
func to_string() -> String
func tr(message: StringName, context: StringName = &"") -> String
func tr_n(message: StringName, plural_message: StringName, n: int, context: StringName = &"") -> String

Signals

signal editing_toggled(toggled_on: bool)

Emitted when the LineEdit switches in or out of edit mode.

signal text_change_rejected(rejected_substring: String)

Emitted when appending text that overflows the max_length. The appended text is truncated to fit max_length, and the part that couldn't fit is passed as the rejected_substring argument.

signal text_changed(new_text: String)

Emitted when the text changes.

signal text_submitted(new_text: String)

Emitted when the user presses the ui_text_submit action (by default: Enter or Kp Enter) while the LineEdit has focus.

Inherited from Control (10)
signal focus_entered()
signal focus_exited()
signal gui_input(event: InputEvent)
signal mouse_entered()
signal mouse_exited()
signal resized()
signal theme_changed()
Inherited from CanvasItem (4)
signal draw()
signal hidden()
Inherited from Node (11)
signal child_entered_tree(node: Node)
signal child_exiting_tree(node: Node)
signal ready()
signal renamed()
signal replacing_by(node: Node)
signal tree_entered()
signal tree_exited()
signal tree_exiting()
Inherited from Object (2)

Enums & Constants

enum MenuItems
MENU_CUT = 0

Cuts (copies and clears) the selected text.

MENU_COPY = 1

Copies the selected text.

MENU_PASTE = 2

Pastes the clipboard text over the selected text (or at the caret's position).

Non-printable escape characters are automatically stripped from the OS clipboard via String.strip_escapes().

MENU_CLEAR = 3

Erases the whole LineEdit text.

MENU_SELECT_ALL = 4

Selects the whole LineEdit text.

MENU_UNDO = 5

Undoes the previous action.

MENU_REDO = 6

Reverse the last undo action.

MENU_SUBMENU_TEXT_DIR = 7

ID of "Text Writing Direction" submenu.

MENU_DIR_INHERITED = 8

Sets text direction to inherited.

MENU_DIR_AUTO = 9

Sets text direction to automatic.

MENU_DIR_LTR = 10

Sets text direction to left-to-right.

MENU_DIR_RTL = 11

Sets text direction to right-to-left.

MENU_DISPLAY_UCC = 12

Toggles control character display.

MENU_SUBMENU_INSERT_UCC = 13

ID of "Insert Control Character" submenu.

MENU_INSERT_LRM = 14

Inserts left-to-right mark (LRM) character.

MENU_INSERT_RLM = 15

Inserts right-to-left mark (RLM) character.

MENU_INSERT_LRE = 16

Inserts start of left-to-right embedding (LRE) character.

MENU_INSERT_RLE = 17

Inserts start of right-to-left embedding (RLE) character.

MENU_INSERT_LRO = 18

Inserts start of left-to-right override (LRO) character.

MENU_INSERT_RLO = 19

Inserts start of right-to-left override (RLO) character.

MENU_INSERT_PDF = 20

Inserts pop direction formatting (PDF) character.

MENU_INSERT_ALM = 21

Inserts Arabic letter mark (ALM) character.

MENU_INSERT_LRI = 22

Inserts left-to-right isolate (LRI) character.

MENU_INSERT_RLI = 23

Inserts right-to-left isolate (RLI) character.

MENU_INSERT_FSI = 24

Inserts first strong isolate (FSI) character.

MENU_INSERT_PDI = 25

Inserts pop direction isolate (PDI) character.

MENU_INSERT_ZWJ = 26

Inserts zero width joiner (ZWJ) character.

MENU_INSERT_ZWNJ = 27

Inserts zero width non-joiner (ZWNJ) character.

MENU_INSERT_WJ = 28

Inserts word joiner (WJ) character.

MENU_INSERT_SHY = 29

Inserts soft hyphen (SHY) character.

MENU_EMOJI_AND_SYMBOL = 30

Opens system emoji and symbol picker.

MENU_MAX = 31

Represents the size of the MenuItems enum.

enum VirtualKeyboardType
KEYBOARD_TYPE_DEFAULT = 0

Default text virtual keyboard.

KEYBOARD_TYPE_MULTILINE = 1

Multiline virtual keyboard.

KEYBOARD_TYPE_NUMBER = 2

Virtual number keypad, useful for PIN entry.

KEYBOARD_TYPE_NUMBER_DECIMAL = 3

Virtual number keypad, useful for entering fractional numbers.

KEYBOARD_TYPE_PHONE = 4

Virtual phone number keypad.

KEYBOARD_TYPE_EMAIL_ADDRESS = 5

Virtual keyboard with additional keys to assist with typing email addresses.

KEYBOARD_TYPE_PASSWORD = 6

Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization.

Note: This is not supported on Web. Instead, this behaves identically to KEYBOARD_TYPE_DEFAULT.

KEYBOARD_TYPE_URL = 7

Virtual keyboard with additional keys to assist with typing URLs.

enum ExpandMode
EXPAND_MODE_ORIGINAL_SIZE = 0

Use the original size for the right icon.

EXPAND_MODE_FIT_TO_TEXT = 1

Scale the right icon's size to match the size of the text.

EXPAND_MODE_FIT_TO_LINE_EDIT = 2

Scale the right icon to fit the LineEdit.