.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_LineEdit: LineEdit ======== **Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Control that provides single line string editing. Member Functions ---------------- +------------------------------+--------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_align` **(** :ref:`int` align **)** | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_align` **(** **)** const | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | void | :ref:`select_all` **(** **)** | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_text` **(** :ref:`String` text **)** | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_text` **(** **)** const | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_cursor_pos` **(** :ref:`int` pos **)** | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_cursor_pos` **(** **)** const | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_max_length` **(** :ref:`int` chars **)** | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_max_length` **(** **)** const | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | void | :ref:`append_at_cursor` **(** :ref:`String` text **)** | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_editable` **(** :ref:`bool` enabled **)** | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_editable` **(** **)** const | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_secret` **(** :ref:`bool` enabled **)** | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_secret` **(** **)** const | +------------------------------+--------------------------------------------------------------------------------------------------------------+ | void | :ref:`select` **(** :ref:`int` from=0, :ref:`int` to=-1 **)** | +------------------------------+--------------------------------------------------------------------------------------------------------------+ Signals ------- - **text_entered** **(** :ref:`String` text **)** - **text_changed** **(** :ref:`String` text **)** Numeric Constants ----------------- - **ALIGN_LEFT** = **0** - **ALIGN_CENTER** = **1** - **ALIGN_RIGHT** = **2** - **ALIGN_FILL** = **3** Description ----------- LineEdit provides a single line string editor, used for text fields. Member Function Description --------------------------- .. _class_LineEdit_set_align: - void **set_align** **(** :ref:`int` align **)** .. _class_LineEdit_get_align: - :ref:`int` **get_align** **(** **)** const .. _class_LineEdit_clear: - void **clear** **(** **)** Clear the :ref:`LineEdit` text. .. _class_LineEdit_select_all: - void **select_all** **(** **)** Select the whole string. .. _class_LineEdit_set_text: - void **set_text** **(** :ref:`String` text **)** Set the text in the :ref:`LineEdit`, clearing the existing one and the selection. .. _class_LineEdit_get_text: - :ref:`String` **get_text** **(** **)** const Return the text in the :ref:`LineEdit`. .. _class_LineEdit_set_cursor_pos: - void **set_cursor_pos** **(** :ref:`int` pos **)** Set the cursor position inside the :ref:`LineEdit`, causing it to scroll if needed. .. _class_LineEdit_get_cursor_pos: - :ref:`int` **get_cursor_pos** **(** **)** const Return the cursor position inside the :ref:`LineEdit`. .. _class_LineEdit_set_max_length: - void **set_max_length** **(** :ref:`int` chars **)** Set the maximum amount of characters the :ref:`LineEdit` can edit, and cropping existing text in case it exceeds that limit. Setting 0 removes the limit. .. _class_LineEdit_get_max_length: - :ref:`int` **get_max_length** **(** **)** const Return the maximum amount of characters the :ref:`LineEdit` can edit. If 0 is returned, no limit exists. .. _class_LineEdit_append_at_cursor: - void **append_at_cursor** **(** :ref:`String` text **)** Append text at cursor, scrolling the :ref:`LineEdit` when needed. .. _class_LineEdit_set_editable: - void **set_editable** **(** :ref:`bool` enabled **)** Set the *editable* status of the :ref:`LineEdit`. When disabled, existing text can't be modified and new text can't be added. .. _class_LineEdit_is_editable: - :ref:`bool` **is_editable** **(** **)** const Return the *editable* status of the :ref:`LineEdit` (see :ref:`set_editable`). .. _class_LineEdit_set_secret: - void **set_secret** **(** :ref:`bool` enabled **)** Set the *secret* status of the :ref:`LineEdit`. When enabled, every character is displayed as "\*". .. _class_LineEdit_is_secret: - :ref:`bool` **is_secret** **(** **)** const Return the *secret* status of the :ref:`LineEdit` (see :ref:`set_secret`). .. _class_LineEdit_select: - void **select** **(** :ref:`int` from=0, :ref:`int` to=-1 **)**