mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
1977 lines
91 KiB
ReStructuredText
1977 lines
91 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. meta::
|
||
:keywords: text, input
|
||
|
||
.. _class_LineEdit:
|
||
|
||
LineEdit
|
||
========
|
||
|
||
**繼承:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
||
單行文字的輸入欄位。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
說明
|
||
----
|
||
|
||
**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 :ref:`keep_editing_on_text_submit<class_LineEdit_property_keep_editing_on_text_submit>`.
|
||
|
||
- To exit edit mode, press ``ui_text_submit`` or ``ui_cancel`` (by default :kbd:`Escape`) actions.
|
||
|
||
- Check :ref:`edit()<class_LineEdit_method_edit>`, :ref:`unedit()<class_LineEdit_method_unedit>`, :ref:`is_editing()<class_LineEdit_method_is_editing>`, and :ref:`editing_toggled<class_LineEdit_signal_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 :kbd:`Alt` and type the codepoint on the numpad. For example, to enter the character ``á`` (U+00E1), hold :kbd:`Alt` and type :kbd:`+E1` on the numpad (the leading zeroes can be omitted).
|
||
|
||
- To enter OEM codepoints, hold :kbd:`Alt` and type the code on the numpad. For example, to enter the character ``á`` (OEM 160), hold :kbd:`Alt` and type ``160`` on the numpad.
|
||
|
||
- To enter Windows codepoints, hold :kbd:`Alt` and type the code on the numpad. For example, to enter the character ``á`` (Windows 0225), hold :kbd:`Alt` and type :kbd:`0`, :kbd:`2`, :kbd:`2`, :kbd:`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 :kbd:`Tab`) or ``ui_focus_prev`` (by default :kbd:`Shift + Tab`) or :ref:`Control.grab_focus()<class_Control_method_grab_focus>` still enters edit mode (for compatibility).
|
||
|
||
\ **LineEdit** features many built-in shortcuts that are always available (:kbd:`Ctrl` here maps to :kbd:`Cmd` on macOS):
|
||
|
||
- :kbd:`Ctrl + C`: Copy
|
||
|
||
- :kbd:`Ctrl + X`: Cut
|
||
|
||
- :kbd:`Ctrl + V` or :kbd:`Ctrl + Y`: Paste/"yank"
|
||
|
||
- :kbd:`Ctrl + Z`: Undo
|
||
|
||
- :kbd:`Ctrl + ~`: Swap input direction.
|
||
|
||
- :kbd:`Ctrl + Shift + Z`: Redo
|
||
|
||
- :kbd:`Ctrl + U`: Delete text from the caret position to the beginning of the line
|
||
|
||
- :kbd:`Ctrl + K`: Delete text from the caret position to the end of the line
|
||
|
||
- :kbd:`Ctrl + A`: Select all text
|
||
|
||
- :kbd:`Up Arrow`/:kbd:`Down Arrow`: Move the caret to the beginning/end of the line
|
||
|
||
On macOS, some extra keyboard shortcuts are available:
|
||
|
||
- :kbd:`Cmd + F`: Same as :kbd:`Right Arrow`, move the caret one character right
|
||
|
||
- :kbd:`Cmd + B`: Same as :kbd:`Left Arrow`, move the caret one character left
|
||
|
||
- :kbd:`Cmd + P`: Same as :kbd:`Up Arrow`, move the caret to the previous line
|
||
|
||
- :kbd:`Cmd + N`: Same as :kbd:`Down Arrow`, move the caret to the next line
|
||
|
||
- :kbd:`Cmd + D`: Same as :kbd:`Delete`, delete the character on the right side of caret
|
||
|
||
- :kbd:`Cmd + H`: Same as :kbd:`Backspace`, delete the character on the left side of the caret
|
||
|
||
- :kbd:`Cmd + A`: Same as :kbd:`Home`, move the caret to the beginning of the line
|
||
|
||
- :kbd:`Cmd + E`: Same as :kbd:`End`, move the caret to the end of the line
|
||
|
||
- :kbd:`Cmd + Left Arrow`: Same as :kbd:`Home`, move the caret to the beginning of the line
|
||
|
||
- :kbd:`Cmd + Right Arrow`: Same as :kbd:`End`, move the caret to the end of the line
|
||
|
||
\ **Note:** Caret movement shortcuts listed above are not affected by :ref:`shortcut_keys_enabled<class_LineEdit_property_shortcut_keys_enabled>`.
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
屬性
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`alignment<class_LineEdit_property_alignment>` | ``0`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`backspace_deletes_composite_character_enabled<class_LineEdit_property_backspace_deletes_composite_character_enabled>` | ``false`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`caret_blink<class_LineEdit_property_caret_blink>` | ``false`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`caret_blink_interval<class_LineEdit_property_caret_blink_interval>` | ``0.65`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`caret_column<class_LineEdit_property_caret_column>` | ``0`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`caret_force_displayed<class_LineEdit_property_caret_force_displayed>` | ``false`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`caret_mid_grapheme<class_LineEdit_property_caret_mid_grapheme>` | ``false`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>` | ``false`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_LineEdit_property_context_menu_enabled>` | ``true`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`deselect_on_focus_loss_enabled<class_LineEdit_property_deselect_on_focus_loss_enabled>` | ``true`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`drag_and_drop_selection_enabled<class_LineEdit_property_drag_and_drop_selection_enabled>` | ``true`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`draw_control_chars<class_LineEdit_property_draw_control_chars>` | ``false`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`editable<class_LineEdit_property_editable>` | ``true`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`emoji_menu_enabled<class_LineEdit_property_emoji_menu_enabled>` | ``true`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`expand_to_text_length<class_LineEdit_property_expand_to_text_length>` | ``false`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`flat<class_LineEdit_property_flat>` | ``false`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`ExpandMode<enum_LineEdit_ExpandMode>` | :ref:`icon_expand_mode<class_LineEdit_property_icon_expand_mode>` | ``0`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`keep_editing_on_text_submit<class_LineEdit_property_keep_editing_on_text_submit>` | ``false`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`language<class_LineEdit_property_language>` | ``""`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`max_length<class_LineEdit_property_max_length>` | ``0`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`middle_mouse_paste_enabled<class_LineEdit_property_middle_mouse_paste_enabled>` | ``true`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`CursorShape<enum_Control_CursorShape>` | mouse_default_cursor_shape | ``1`` (overrides :ref:`Control<class_Control_property_mouse_default_cursor_shape>`) |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`placeholder_text<class_LineEdit_property_placeholder_text>` | ``""`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`Texture2D<class_Texture2D>` | :ref:`right_icon<class_LineEdit_property_right_icon>` | |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`right_icon_scale<class_LineEdit_property_right_icon_scale>` | ``1.0`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`secret<class_LineEdit_property_secret>` | ``false`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`secret_character<class_LineEdit_property_secret_character>` | ``"•"`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`select_all_on_focus<class_LineEdit_property_select_all_on_focus>` | ``false`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`selecting_enabled<class_LineEdit_property_selecting_enabled>` | ``true`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`shortcut_keys_enabled<class_LineEdit_property_shortcut_keys_enabled>` | ``true`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_LineEdit_property_structured_text_bidi_override>` | ``0`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_LineEdit_property_structured_text_bidi_override_options>` | ``[]`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`text<class_LineEdit_property_text>` | ``""`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`text_direction<class_LineEdit_property_text_direction>` | ``0`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`virtual_keyboard_enabled<class_LineEdit_property_virtual_keyboard_enabled>` | ``true`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`virtual_keyboard_show_on_focus<class_LineEdit_property_virtual_keyboard_show_on_focus>` | ``true`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
| :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` | :ref:`virtual_keyboard_type<class_LineEdit_property_virtual_keyboard_type>` | ``0`` |
|
||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
方法
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`apply_ime<class_LineEdit_method_apply_ime>`\ (\ ) |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`cancel_ime<class_LineEdit_method_cancel_ime>`\ (\ ) |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear<class_LineEdit_method_clear>`\ (\ ) |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`delete_char_at_caret<class_LineEdit_method_delete_char_at_caret>`\ (\ ) |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`delete_text<class_LineEdit_method_delete_text>`\ (\ from_column\: :ref:`int<class_int>`, to_column\: :ref:`int<class_int>`\ ) |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`deselect<class_LineEdit_method_deselect>`\ (\ ) |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`edit<class_LineEdit_method_edit>`\ (\ hide_focus\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_LineEdit_method_get_menu>`\ (\ ) |const| |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_next_composite_character_column<class_LineEdit_method_get_next_composite_character_column>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_previous_composite_character_column<class_LineEdit_method_get_previous_composite_character_column>`\ (\ column\: :ref:`int<class_int>`\ ) |const| |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`get_scroll_offset<class_LineEdit_method_get_scroll_offset>`\ (\ ) |const| |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_selected_text<class_LineEdit_method_get_selected_text>`\ (\ ) |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_selection_from_column<class_LineEdit_method_get_selection_from_column>`\ (\ ) |const| |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_selection_to_column<class_LineEdit_method_get_selection_to_column>`\ (\ ) |const| |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_ime_text<class_LineEdit_method_has_ime_text>`\ (\ ) |const| |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_redo<class_LineEdit_method_has_redo>`\ (\ ) |const| |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_selection<class_LineEdit_method_has_selection>`\ (\ ) |const| |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_undo<class_LineEdit_method_has_undo>`\ (\ ) |const| |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`insert_text_at_caret<class_LineEdit_method_insert_text_at_caret>`\ (\ text\: :ref:`String<class_String>`\ ) |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_editing<class_LineEdit_method_is_editing>`\ (\ ) |const| |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_menu_visible<class_LineEdit_method_is_menu_visible>`\ (\ ) |const| |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`menu_option<class_LineEdit_method_menu_option>`\ (\ option\: :ref:`int<class_int>`\ ) |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`select<class_LineEdit_method_select>`\ (\ from\: :ref:`int<class_int>` = 0, to\: :ref:`int<class_int>` = -1\ ) |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`select_all<class_LineEdit_method_select_all>`\ (\ ) |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`unedit<class_LineEdit_method_unedit>`\ (\ ) |
|
||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
主題屬性
|
||
--------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`caret_color<class_LineEdit_theme_color_caret_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`clear_button_color<class_LineEdit_theme_color_clear_button_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`clear_button_color_pressed<class_LineEdit_theme_color_clear_button_color_pressed>` | ``Color(1, 1, 1, 1)`` |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`font_color<class_LineEdit_theme_color_font_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`font_outline_color<class_LineEdit_theme_color_font_outline_color>` | ``Color(0, 0, 0, 1)`` |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`font_placeholder_color<class_LineEdit_theme_color_font_placeholder_color>` | ``Color(0.875, 0.875, 0.875, 0.6)`` |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`font_selected_color<class_LineEdit_theme_color_font_selected_color>` | ``Color(1, 1, 1, 1)`` |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`font_uneditable_color<class_LineEdit_theme_color_font_uneditable_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`selection_color<class_LineEdit_theme_color_selection_color>` | ``Color(0.5, 0.5, 0.5, 1)`` |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`caret_width<class_LineEdit_theme_constant_caret_width>` | ``1`` |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`minimum_character_width<class_LineEdit_theme_constant_minimum_character_width>` | ``4`` |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`outline_size<class_LineEdit_theme_constant_outline_size>` | ``0`` |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`Font<class_Font>` | :ref:`font<class_LineEdit_theme_font_font>` | |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`font_size<class_LineEdit_theme_font_size_font_size>` | |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`Texture2D<class_Texture2D>` | :ref:`clear<class_LineEdit_theme_icon_clear>` | |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_LineEdit_theme_style_focus>` | |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_LineEdit_theme_style_normal>` | |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`read_only<class_LineEdit_theme_style_read_only>` | |
|
||
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
訊號
|
||
----
|
||
|
||
.. _class_LineEdit_signal_editing_toggled:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**editing_toggled**\ (\ toggled_on\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_LineEdit_signal_editing_toggled>`
|
||
|
||
Emitted when the **LineEdit** switches in or out of edit mode.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_signal_text_change_rejected:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**text_change_rejected**\ (\ rejected_substring\: :ref:`String<class_String>`\ ) :ref:`🔗<class_LineEdit_signal_text_change_rejected>`
|
||
|
||
當追加的文字超過了 :ref:`max_length<class_LineEdit_property_max_length>` 時觸發。追加後的文字會被截斷以適應 :ref:`max_length<class_LineEdit_property_max_length>`\ ,超出的部分會被作為 ``rejected_substring`` 參數傳遞。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_signal_text_changed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**text_changed**\ (\ new_text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_LineEdit_signal_text_changed>`
|
||
|
||
當文字更改時觸發。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_signal_text_submitted:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**text_submitted**\ (\ new_text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_LineEdit_signal_text_submitted>`
|
||
|
||
Emitted when the user presses the ``ui_text_submit`` action (by default: :kbd:`Enter` or :kbd:`Kp Enter`) while the **LineEdit** has focus.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
列舉
|
||
----
|
||
|
||
.. _enum_LineEdit_MenuItems:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **MenuItems**: :ref:`🔗<enum_LineEdit_MenuItems>`
|
||
|
||
.. _class_LineEdit_constant_MENU_CUT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_CUT** = ``0``
|
||
|
||
剪切(複製並刪除)選中的文字。
|
||
|
||
.. _class_LineEdit_constant_MENU_COPY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_COPY** = ``1``
|
||
|
||
複製選中的文字。
|
||
|
||
.. _class_LineEdit_constant_MENU_PASTE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_PASTE** = ``2``
|
||
|
||
將剪貼板中的文字貼上到選中文字之上(或者文字游標位置)。
|
||
|
||
會使用 :ref:`String.strip_escapes()<class_String_method_strip_escapes>` 自動剝離作業系統剪貼板中不可列印的轉義字符。
|
||
|
||
.. _class_LineEdit_constant_MENU_CLEAR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_CLEAR** = ``3``
|
||
|
||
刪除 **LineEdit** 中的全部文字。
|
||
|
||
.. _class_LineEdit_constant_MENU_SELECT_ALL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_SELECT_ALL** = ``4``
|
||
|
||
選中 **LineEdit** 中的全部文字。
|
||
|
||
.. _class_LineEdit_constant_MENU_UNDO:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_UNDO** = ``5``
|
||
|
||
撤銷之前的操作。
|
||
|
||
.. _class_LineEdit_constant_MENU_REDO:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_REDO** = ``6``
|
||
|
||
反轉最後一個撤銷動作。
|
||
|
||
.. _class_LineEdit_constant_MENU_SUBMENU_TEXT_DIR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_SUBMENU_TEXT_DIR** = ``7``
|
||
|
||
“文字書寫方向”子功能表的 ID。
|
||
|
||
.. _class_LineEdit_constant_MENU_DIR_INHERITED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_INHERITED** = ``8``
|
||
|
||
將文字方向設定為繼承。
|
||
|
||
.. _class_LineEdit_constant_MENU_DIR_AUTO:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_AUTO** = ``9``
|
||
|
||
將文字方向設定為自動。
|
||
|
||
.. _class_LineEdit_constant_MENU_DIR_LTR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_LTR** = ``10``
|
||
|
||
將文字方向設定為從左至右。
|
||
|
||
.. _class_LineEdit_constant_MENU_DIR_RTL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_RTL** = ``11``
|
||
|
||
將文字方向設定為從右至左。
|
||
|
||
.. _class_LineEdit_constant_MENU_DISPLAY_UCC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DISPLAY_UCC** = ``12``
|
||
|
||
切換控制字元的顯示。
|
||
|
||
.. _class_LineEdit_constant_MENU_SUBMENU_INSERT_UCC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_SUBMENU_INSERT_UCC** = ``13``
|
||
|
||
“插入控制字元”子功能表的 ID。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_LRM:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRM** = ``14``
|
||
|
||
插入從左至右旗標(LRM)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_RLM:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLM** = ``15``
|
||
|
||
插入從右至左旗標(LRM)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_LRE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRE** = ``16``
|
||
|
||
插入開始從左至右嵌入(LRE)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_RLE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLE** = ``17``
|
||
|
||
插入開始從右至左嵌入(RLE)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_LRO:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRO** = ``18``
|
||
|
||
插入開始從左至右強制(LRO)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_RLO:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLO** = ``19``
|
||
|
||
插入開始從右至左嵌入(RLE)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_PDF:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_PDF** = ``20``
|
||
|
||
插入退出方向格式化(PDF)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_ALM:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_ALM** = ``21``
|
||
|
||
插入阿拉伯字母標記(ALM)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_LRI:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRI** = ``22``
|
||
|
||
插入從左至右隔離(LRI)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_RLI:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLI** = ``23``
|
||
|
||
插入從右至左隔離(RLI)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_FSI:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_FSI** = ``24``
|
||
|
||
插入第一個強隔離(FSI)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_PDI:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_PDI** = ``25``
|
||
|
||
插入退出方向隔離(PDI)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_ZWJ:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_ZWJ** = ``26``
|
||
|
||
插入零寬連接子(ZWJ)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_ZWNJ:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_ZWNJ** = ``27``
|
||
|
||
插入零寬非連接子(ZWNJ)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_WJ:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_WJ** = ``28``
|
||
|
||
插入文字連接子(WJ)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_INSERT_SHY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_SHY** = ``29``
|
||
|
||
插入軟連字號(SHY)字元。
|
||
|
||
.. _class_LineEdit_constant_MENU_EMOJI_AND_SYMBOL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_EMOJI_AND_SYMBOL** = ``30``
|
||
|
||
Opens system emoji and symbol picker.
|
||
|
||
.. _class_LineEdit_constant_MENU_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_MAX** = ``31``
|
||
|
||
代表 :ref:`MenuItems<enum_LineEdit_MenuItems>` 列舉的大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_LineEdit_VirtualKeyboardType:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **VirtualKeyboardType**: :ref:`🔗<enum_LineEdit_VirtualKeyboardType>`
|
||
|
||
.. _class_LineEdit_constant_KEYBOARD_TYPE_DEFAULT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_DEFAULT** = ``0``
|
||
|
||
預設文字虛擬鍵盤。
|
||
|
||
.. _class_LineEdit_constant_KEYBOARD_TYPE_MULTILINE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_MULTILINE** = ``1``
|
||
|
||
多行虛擬鍵盤。
|
||
|
||
.. _class_LineEdit_constant_KEYBOARD_TYPE_NUMBER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER** = ``2``
|
||
|
||
虛擬數位鍵盤,可用於 PIN 輸入。
|
||
|
||
.. _class_LineEdit_constant_KEYBOARD_TYPE_NUMBER_DECIMAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER_DECIMAL** = ``3``
|
||
|
||
虛擬數位鍵盤,可用於輸入小數。
|
||
|
||
.. _class_LineEdit_constant_KEYBOARD_TYPE_PHONE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_PHONE** = ``4``
|
||
|
||
虛擬手機號碼鍵盤。
|
||
|
||
.. _class_LineEdit_constant_KEYBOARD_TYPE_EMAIL_ADDRESS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_EMAIL_ADDRESS** = ``5``
|
||
|
||
帶有附加鍵的虛擬鍵盤,可説明輸入電子郵寄地址。
|
||
|
||
.. _class_LineEdit_constant_KEYBOARD_TYPE_PASSWORD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_PASSWORD** = ``6``
|
||
|
||
用於輸入密碼的虛擬鍵盤。在大多數平臺上,這應該會禁用自動完成和自動首字母大寫功能。
|
||
|
||
\ **注意:**\ Web 平臺不支援。與 :ref:`KEYBOARD_TYPE_DEFAULT<class_LineEdit_constant_KEYBOARD_TYPE_DEFAULT>` 的行為相同。
|
||
|
||
.. _class_LineEdit_constant_KEYBOARD_TYPE_URL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_URL** = ``7``
|
||
|
||
帶有附加鍵的虛擬鍵盤,可説明輸入 URL。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_LineEdit_ExpandMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **ExpandMode**: :ref:`🔗<enum_LineEdit_ExpandMode>`
|
||
|
||
.. _class_LineEdit_constant_EXPAND_MODE_ORIGINAL_SIZE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ExpandMode<enum_LineEdit_ExpandMode>` **EXPAND_MODE_ORIGINAL_SIZE** = ``0``
|
||
|
||
Use the original size for the right icon.
|
||
|
||
.. _class_LineEdit_constant_EXPAND_MODE_FIT_TO_TEXT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ExpandMode<enum_LineEdit_ExpandMode>` **EXPAND_MODE_FIT_TO_TEXT** = ``1``
|
||
|
||
Scale the right icon's size to match the size of the text.
|
||
|
||
.. _class_LineEdit_constant_EXPAND_MODE_FIT_TO_LINE_EDIT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ExpandMode<enum_LineEdit_ExpandMode>` **EXPAND_MODE_FIT_TO_LINE_EDIT** = ``2``
|
||
|
||
Scale the right icon to fit the LineEdit.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
屬性說明
|
||
--------
|
||
|
||
.. _class_LineEdit_property_alignment:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **alignment** = ``0`` :ref:`🔗<class_LineEdit_property_alignment>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_horizontal_alignment**\ (\ value\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`\ )
|
||
- :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_horizontal_alignment**\ (\ )
|
||
|
||
The text's horizontal alignment.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_backspace_deletes_composite_character_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **backspace_deletes_composite_character_enabled** = ``false`` :ref:`🔗<class_LineEdit_property_backspace_deletes_composite_character_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_backspace_deletes_composite_character_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_backspace_deletes_composite_character_enabled**\ (\ )
|
||
|
||
If ``true`` and :ref:`caret_mid_grapheme<class_LineEdit_property_caret_mid_grapheme>` is ``false``, backspace deletes an entire composite character such as ❤️🩹, instead of deleting part of the composite character.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_caret_blink:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **caret_blink** = ``false`` :ref:`🔗<class_LineEdit_property_caret_blink>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_caret_blink_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_caret_blink_enabled**\ (\ )
|
||
|
||
如果為 ``true``\ ,則文字游標會閃爍。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_caret_blink_interval:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **caret_blink_interval** = ``0.65`` :ref:`🔗<class_LineEdit_property_caret_blink_interval>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_caret_blink_interval**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_caret_blink_interval**\ (\ )
|
||
|
||
文字游標的閃爍間隔(單位為秒)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_caret_column:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`int<class_int>` **caret_column** = ``0`` :ref:`🔗<class_LineEdit_property_caret_column>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_caret_column**\ (\ value\: :ref:`int<class_int>`\ )
|
||
- :ref:`int<class_int>` **get_caret_column**\ (\ )
|
||
|
||
**LineEdit** 中游標的列位置。設定後文字可能會滾動以適應它。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_caret_force_displayed:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **caret_force_displayed** = ``false`` :ref:`🔗<class_LineEdit_property_caret_force_displayed>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_caret_force_displayed**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_caret_force_displayed**\ (\ )
|
||
|
||
If ``true``, the **LineEdit** will always show the caret, even if not editing or focus is lost.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_caret_mid_grapheme:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **caret_mid_grapheme** = ``false`` :ref:`🔗<class_LineEdit_property_caret_mid_grapheme>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_caret_mid_grapheme_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_caret_mid_grapheme_enabled**\ (\ )
|
||
|
||
允許在單個複合字元的元件中進行移動游標、選中、刪除的操作。
|
||
|
||
\ **注意:**\ 倒退鍵 :kbd:`Backspace` 始終按複合字元的元件刪除。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_clear_button_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **clear_button_enabled** = ``false`` :ref:`🔗<class_LineEdit_property_clear_button_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_clear_button_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_clear_button_enabled**\ (\ )
|
||
|
||
如果為 ``true``\ ,\ **LineEdit** 將在 :ref:`text<class_LineEdit_property_text>` 非空時顯示清空按鈕,可以用來快速清除文字。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_context_menu_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **context_menu_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_context_menu_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_context_menu_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_context_menu_enabled**\ (\ )
|
||
|
||
如果為 ``true``\ ,按右鍵將出現本文選單。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_deselect_on_focus_loss_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **deselect_on_focus_loss_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_deselect_on_focus_loss_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_deselect_on_focus_loss_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_deselect_on_focus_loss_enabled**\ (\ )
|
||
|
||
如果為 ``true``\ ,則在丟失焦點時會取消選中文字。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_drag_and_drop_selection_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **drag_and_drop_selection_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_drag_and_drop_selection_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_drag_and_drop_selection_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_drag_and_drop_selection_enabled**\ (\ )
|
||
|
||
如果為 ``true``\ ,則允許拖放選中的文字。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_draw_control_chars:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **draw_control_chars** = ``false`` :ref:`🔗<class_LineEdit_property_draw_control_chars>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_draw_control_chars**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_draw_control_chars**\ (\ )
|
||
|
||
如果為 ``true``\ ,則會顯示控制字元。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_editable:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **editable** = ``true`` :ref:`🔗<class_LineEdit_property_editable>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_editable**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_editable**\ (\ )
|
||
|
||
如果為 ``false``\ ,則不能修改現在的文字,也不能新增新文字。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_emoji_menu_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **emoji_menu_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_emoji_menu_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_emoji_menu_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_emoji_menu_enabled**\ (\ )
|
||
|
||
If ``true``, "Emoji and Symbols" menu is enabled.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_expand_to_text_length:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **expand_to_text_length** = ``false`` :ref:`🔗<class_LineEdit_property_expand_to_text_length>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_expand_to_text_length_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_expand_to_text_length_enabled**\ (\ )
|
||
|
||
如果為 ``true``\ ,則 **LineEdit** 寬度將增加到比 :ref:`text<class_LineEdit_property_text>` 長。如果 :ref:`text<class_LineEdit_property_text>` 被縮短,它將\ **不**\ 壓縮。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_flat:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **flat** = ``false`` :ref:`🔗<class_LineEdit_property_flat>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flat**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_flat**\ (\ )
|
||
|
||
如果為 ``true``\ ,則 **LineEdit** 不顯示裝飾。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_icon_expand_mode:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`ExpandMode<enum_LineEdit_ExpandMode>` **icon_expand_mode** = ``0`` :ref:`🔗<class_LineEdit_property_icon_expand_mode>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_icon_expand_mode**\ (\ value\: :ref:`ExpandMode<enum_LineEdit_ExpandMode>`\ )
|
||
- :ref:`ExpandMode<enum_LineEdit_ExpandMode>` **get_icon_expand_mode**\ (\ )
|
||
|
||
Define the scaling behavior of the :ref:`right_icon<class_LineEdit_property_right_icon>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_keep_editing_on_text_submit:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **keep_editing_on_text_submit** = ``false`` :ref:`🔗<class_LineEdit_property_keep_editing_on_text_submit>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_keep_editing_on_text_submit**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_editing_kept_on_text_submit**\ (\ )
|
||
|
||
If ``true``, the **LineEdit** will not exit edit mode when text is submitted by pressing ``ui_text_submit`` action (by default: :kbd:`Enter` or :kbd:`Kp Enter`).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_language:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **language** = ``""`` :ref:`🔗<class_LineEdit_property_language>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_language**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_language**\ (\ )
|
||
|
||
Language code used for line-breaking and text shaping algorithms. If left empty, the current locale is used instead.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_max_length:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`int<class_int>` **max_length** = ``0`` :ref:`🔗<class_LineEdit_property_max_length>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_max_length**\ (\ value\: :ref:`int<class_int>`\ )
|
||
- :ref:`int<class_int>` **get_max_length**\ (\ )
|
||
|
||
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 :ref:`max_length<class_LineEdit_property_max_length>` are truncated. This happens both for existing :ref:`text<class_LineEdit_property_text>` contents when setting the max length, or for new text inserted in the **LineEdit**, including pasting.
|
||
|
||
If any input text is truncated, the :ref:`text_change_rejected<class_LineEdit_signal_text_change_rejected>` signal is emitted with the truncated substring as a parameter:
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
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.
|
||
|
||
.. code-tab:: csharp
|
||
|
||
Text = "Hello world";
|
||
MaxLength = 5;
|
||
// `Text` becomes "Hello".
|
||
MaxLength = 10;
|
||
Text += " goodbye";
|
||
// `Text` becomes "Hello good".
|
||
// `text_change_rejected` is emitted with "bye" as a parameter.
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_middle_mouse_paste_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **middle_mouse_paste_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_middle_mouse_paste_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_middle_mouse_paste_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_middle_mouse_paste_enabled**\ (\ )
|
||
|
||
如果為 ``false``\ ,將禁用滑鼠中鍵貼上剪貼板。
|
||
|
||
\ **注意:**\ 這個方法只在 Linux 上實作。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_placeholder_text:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **placeholder_text** = ``""`` :ref:`🔗<class_LineEdit_property_placeholder_text>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_placeholder**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_placeholder**\ (\ )
|
||
|
||
當 **LineEdit** 為空時顯示的文字。它\ **不是** **LineEdit** 的預設值(見 :ref:`text<class_LineEdit_property_text>`\ )。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_right_icon:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **right_icon** :ref:`🔗<class_LineEdit_property_right_icon>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_right_icon**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
|
||
- :ref:`Texture2D<class_Texture2D>` **get_right_icon**\ (\ )
|
||
|
||
設定 **LineEdit** 右端的圖示,這個圖示會在沒有 :ref:`text<class_LineEdit_property_text>` 時出現,如果 :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>` 為 ``false`` 則始終可見。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_right_icon_scale:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **right_icon_scale** = ``1.0`` :ref:`🔗<class_LineEdit_property_right_icon_scale>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_right_icon_scale**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_right_icon_scale**\ (\ )
|
||
|
||
Scale ratio of the icon when :ref:`icon_expand_mode<class_LineEdit_property_icon_expand_mode>` is set to :ref:`EXPAND_MODE_FIT_TO_LINE_EDIT<class_LineEdit_constant_EXPAND_MODE_FIT_TO_LINE_EDIT>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_secret:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **secret** = ``false`` :ref:`🔗<class_LineEdit_property_secret>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_secret**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_secret**\ (\ )
|
||
|
||
如果為 ``true``\ ,則每個字元都會被替換成密碼字元(見 :ref:`secret_character<class_LineEdit_property_secret_character>`\ )。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_secret_character:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **secret_character** = ``"•"`` :ref:`🔗<class_LineEdit_property_secret_character>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_secret_character**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_secret_character**\ (\ )
|
||
|
||
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.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_select_all_on_focus:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **select_all_on_focus** = ``false`` :ref:`🔗<class_LineEdit_property_select_all_on_focus>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_select_all_on_focus**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_select_all_on_focus**\ (\ )
|
||
|
||
如果為 ``true``\ ,則在獲得焦點時會全選文字。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_selecting_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **selecting_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_selecting_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_selecting_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_selecting_enabled**\ (\ )
|
||
|
||
如果為 ``false``\ ,則無法用滑鼠或鍵盤選擇文字。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_shortcut_keys_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **shortcut_keys_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_shortcut_keys_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_shortcut_keys_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_shortcut_keys_enabled**\ (\ )
|
||
|
||
為 ``true`` 時,即使本文選單已被禁用,也會啟用該本文選單的快捷鍵。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_structured_text_bidi_override:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **structured_text_bidi_override** = ``0`` :ref:`🔗<class_LineEdit_property_structured_text_bidi_override>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_structured_text_bidi_override**\ (\ value\: :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>`\ )
|
||
- :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **get_structured_text_bidi_override**\ (\ )
|
||
|
||
為結構化文字設定 BiDi 演算法覆蓋。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_structured_text_bidi_override_options:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Array<class_Array>` **structured_text_bidi_override_options** = ``[]`` :ref:`🔗<class_LineEdit_property_structured_text_bidi_override_options>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_structured_text_bidi_override_options**\ (\ value\: :ref:`Array<class_Array>`\ )
|
||
- :ref:`Array<class_Array>` **get_structured_text_bidi_override_options**\ (\ )
|
||
|
||
設定 BiDi 覆蓋的附加選項。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_text:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **text** = ``""`` :ref:`🔗<class_LineEdit_property_text>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_text**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_text**\ (\ )
|
||
|
||
**LineEdit** 的字串值。
|
||
|
||
\ **注意:**\ 使用這個屬性更改文字不會觸發 :ref:`text_changed<class_LineEdit_signal_text_changed>` 訊號。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_text_direction:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`TextDirection<enum_Control_TextDirection>` **text_direction** = ``0`` :ref:`🔗<class_LineEdit_property_text_direction>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_text_direction**\ (\ value\: :ref:`TextDirection<enum_Control_TextDirection>`\ )
|
||
- :ref:`TextDirection<enum_Control_TextDirection>` **get_text_direction**\ (\ )
|
||
|
||
基礎文字書寫方向。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_virtual_keyboard_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **virtual_keyboard_enabled** = ``true`` :ref:`🔗<class_LineEdit_property_virtual_keyboard_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_virtual_keyboard_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_virtual_keyboard_enabled**\ (\ )
|
||
|
||
If ``true``, the native virtual keyboard is enabled on platforms that support it.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_virtual_keyboard_show_on_focus:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **virtual_keyboard_show_on_focus** = ``true`` :ref:`🔗<class_LineEdit_property_virtual_keyboard_show_on_focus>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_virtual_keyboard_show_on_focus**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_virtual_keyboard_show_on_focus**\ (\ )
|
||
|
||
If ``true``, the native virtual keyboard is shown on focus events on platforms that support it.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_property_virtual_keyboard_type:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **virtual_keyboard_type** = ``0`` :ref:`🔗<class_LineEdit_property_virtual_keyboard_type>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_virtual_keyboard_type**\ (\ value\: :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>`\ )
|
||
- :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **get_virtual_keyboard_type**\ (\ )
|
||
|
||
指定要顯示的虛擬鍵盤的型別。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
方法說明
|
||
--------
|
||
|
||
.. _class_LineEdit_method_apply_ime:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **apply_ime**\ (\ ) :ref:`🔗<class_LineEdit_method_apply_ime>`
|
||
|
||
Applies text from the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ (IME) and closes the IME if it is open.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_cancel_ime:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **cancel_ime**\ (\ ) :ref:`🔗<class_LineEdit_method_cancel_ime>`
|
||
|
||
Closes the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ (IME) if it is open. Any text in the IME will be lost.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_clear:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear**\ (\ ) :ref:`🔗<class_LineEdit_method_clear>`
|
||
|
||
擦除 **LineEdit** 的 :ref:`text<class_LineEdit_property_text>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_delete_char_at_caret:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **delete_char_at_caret**\ (\ ) :ref:`🔗<class_LineEdit_method_delete_char_at_caret>`
|
||
|
||
刪除游標目前位置處的一個字元(相當於按 :kbd:`Delete`\ )。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_delete_text:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **delete_text**\ (\ from_column\: :ref:`int<class_int>`, to_column\: :ref:`int<class_int>`\ ) :ref:`🔗<class_LineEdit_method_delete_text>`
|
||
|
||
刪除 :ref:`text<class_LineEdit_property_text>` 中從起始列 ``from_column`` 到結束列 ``to_column`` 的部分。兩個參數都應該在文字的長度之內。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_deselect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **deselect**\ (\ ) :ref:`🔗<class_LineEdit_method_deselect>`
|
||
|
||
清除目前選擇。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_edit:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **edit**\ (\ hide_focus\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_LineEdit_method_edit>`
|
||
|
||
Allows entering edit mode whether the **LineEdit** is focused or not. If ``hide_focus`` is ``true``, the focused state will not be shown (see :ref:`Control.grab_focus()<class_Control_method_grab_focus>`).
|
||
|
||
See also :ref:`keep_editing_on_text_submit<class_LineEdit_property_keep_editing_on_text_submit>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_get_menu:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PopupMenu<class_PopupMenu>` **get_menu**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_get_menu>`
|
||
|
||
返回該 **LineEdit** 的 :ref:`PopupMenu<class_PopupMenu>`\ 。預設情況下,右鍵點擊 **LineEdit** 會顯示該菜單。
|
||
|
||
可以新增自訂功能表專案或移除標準功能表專案。確保你的 ID 不與標準 ID 衝突(請參閱 :ref:`MenuItems<enum_LineEdit_MenuItems>`\ )。例如:
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
func _ready():
|
||
var menu = get_menu()
|
||
# 在“重做”之後移除所有專案。
|
||
menu.item_count = menu.get_item_index(MENU_REDO) + 1
|
||
# 新增自訂專案。
|
||
menu.add_separator()
|
||
menu.add_item("Insert Date", MENU_MAX + 1)
|
||
# 連接回呼函式。
|
||
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())
|
||
|
||
.. code-tab:: csharp
|
||
|
||
public override void _Ready()
|
||
{
|
||
var menu = GetMenu();
|
||
// 在“重做”之後移除所有專案。
|
||
menu.ItemCount = menu.GetItemIndex(LineEdit.MenuItems.Redo) + 1;
|
||
// 新增自訂專案。
|
||
menu.AddSeparator();
|
||
menu.AddItem("Insert Date", LineEdit.MenuItems.Max + 1);
|
||
// 新增事件處理器。
|
||
menu.IdPressed += OnItemPressed;
|
||
}
|
||
|
||
public void OnItemPressed(int id)
|
||
{
|
||
if (id == LineEdit.MenuItems.Max + 1)
|
||
{
|
||
InsertTextAtCaret(Time.GetDateStringFromSystem());
|
||
}
|
||
}
|
||
|
||
|
||
|
||
\ **警告:**\ 這是一個必需的內部節點,移除和釋放它可能會導致當機。如果希望隱藏它或它的任何子節點,請使用它們的 :ref:`Window.visible<class_Window_property_visible>` 屬性。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_get_next_composite_character_column:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_next_composite_character_column**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_LineEdit_method_get_next_composite_character_column>`
|
||
|
||
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())``
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_get_previous_composite_character_column:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_previous_composite_character_column**\ (\ column\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_LineEdit_method_get_previous_composite_character_column>`
|
||
|
||
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())``
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_get_scroll_offset:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **get_scroll_offset**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_get_scroll_offset>`
|
||
|
||
返回 :ref:`caret_column<class_LineEdit_property_caret_column>` 引起的滾動偏移量,單位為字元數。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_get_selected_text:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_selected_text**\ (\ ) :ref:`🔗<class_LineEdit_method_get_selected_text>`
|
||
|
||
返回選擇內的文字。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_get_selection_from_column:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_selection_from_column**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_get_selection_from_column>`
|
||
|
||
返回選擇的開始列。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_get_selection_to_column:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_selection_to_column**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_get_selection_to_column>`
|
||
|
||
返回選擇結束列。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_has_ime_text:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_ime_text**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_has_ime_text>`
|
||
|
||
Returns ``true`` if the user has text in the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ (IME).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_has_redo:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_redo**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_has_redo>`
|
||
|
||
有“重做”動作可用時返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_has_selection:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_selection**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_has_selection>`
|
||
|
||
如果使用者選中了文字,則返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_has_undo:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_undo**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_has_undo>`
|
||
|
||
有“撤銷”動作可用時返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_insert_text_at_caret:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **insert_text_at_caret**\ (\ text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_LineEdit_method_insert_text_at_caret>`
|
||
|
||
在游標處插入文字 ``text``\ 。如果最終值比 :ref:`max_length<class_LineEdit_property_max_length>` 長,則不會發生任何事情。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_is_editing:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_editing**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_is_editing>`
|
||
|
||
Returns whether the **LineEdit** is being edited.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_is_menu_visible:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_menu_visible**\ (\ ) |const| :ref:`🔗<class_LineEdit_method_is_menu_visible>`
|
||
|
||
返回選單是否可見。請使用這個方法來代替 ``get_menu().visible``\ ,可以提高性能(因為避免了選單的建立)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_menu_option:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **menu_option**\ (\ option\: :ref:`int<class_int>`\ ) :ref:`🔗<class_LineEdit_method_menu_option>`
|
||
|
||
執行 :ref:`MenuItems<enum_LineEdit_MenuItems>` 列舉中定義的給定操作。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_select:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **select**\ (\ from\: :ref:`int<class_int>` = 0, to\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_LineEdit_method_select>`
|
||
|
||
選擇 **LineEdit** 內介於 ``from`` 和 ``to`` 之間的字元。預設情況下,\ ``from`` 位於開頭,\ ``to`` 位於結尾。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
text = "Welcome"
|
||
select() # 將選擇“Welcome”。
|
||
select(4) # 將選擇“ome”。
|
||
select(2, 5) # 將選擇“lco”。
|
||
|
||
.. code-tab:: csharp
|
||
|
||
Text = "Welcome";
|
||
Select(); // 將選擇“Welcome”。
|
||
Select(4); // 將選擇“ome”。
|
||
Select(2, 5); // 將選擇“lco”。
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_select_all:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **select_all**\ (\ ) :ref:`🔗<class_LineEdit_method_select_all>`
|
||
|
||
選中整個 :ref:`String<class_String>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_method_unedit:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **unedit**\ (\ ) :ref:`🔗<class_LineEdit_method_unedit>`
|
||
|
||
Allows exiting edit mode while preserving focus.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
主題屬性說明
|
||
------------
|
||
|
||
.. _class_LineEdit_theme_color_caret_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **caret_color** = ``Color(0.95, 0.95, 0.95, 1)`` :ref:`🔗<class_LineEdit_theme_color_caret_color>`
|
||
|
||
**LineEdit** 的插入符號(文字游標)的顏色。可以設定為完全透明的顏色,從而完全隱藏游標。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_color_clear_button_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **clear_button_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`🔗<class_LineEdit_theme_color_clear_button_color>`
|
||
|
||
用作清除按鈕預設色調的顏色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_color_clear_button_color_pressed:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **clear_button_color_pressed** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_LineEdit_theme_color_clear_button_color_pressed>`
|
||
|
||
按下清除按鈕時使用的顏色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_color_font_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **font_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`🔗<class_LineEdit_theme_color_font_color>`
|
||
|
||
預設字形顏色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_color_font_outline_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **font_outline_color** = ``Color(0, 0, 0, 1)`` :ref:`🔗<class_LineEdit_theme_color_font_outline_color>`
|
||
|
||
**LineEdit** 文字輪廓的色調。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_color_font_placeholder_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **font_placeholder_color** = ``Color(0.875, 0.875, 0.875, 0.6)`` :ref:`🔗<class_LineEdit_theme_color_font_placeholder_color>`
|
||
|
||
:ref:`placeholder_text<class_LineEdit_property_placeholder_text>` 的字形顏色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_color_font_selected_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **font_selected_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_LineEdit_theme_color_font_selected_color>`
|
||
|
||
選定文字的字形顏色(在選擇矩形內)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_color_font_uneditable_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **font_uneditable_color** = ``Color(0.875, 0.875, 0.875, 0.5)`` :ref:`🔗<class_LineEdit_theme_color_font_uneditable_color>`
|
||
|
||
禁用編輯時的字形顏色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_color_selection_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **selection_color** = ``Color(0.5, 0.5, 0.5, 1)`` :ref:`🔗<class_LineEdit_theme_color_selection_color>`
|
||
|
||
選擇矩形的顏色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_constant_caret_width:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **caret_width** = ``1`` :ref:`🔗<class_LineEdit_theme_constant_caret_width>`
|
||
|
||
文字游標的圖元寬度。使用較大的數值可以提高可存取性,使文字游標更加顯眼,或者確保文字與較大字形尺寸的一致性。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_constant_minimum_character_width:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **minimum_character_width** = ``4`` :ref:`🔗<class_LineEdit_theme_constant_minimum_character_width>`
|
||
|
||
文字的最小水平空間(不包括清除按鈕和內容邊距)。這個值以“M”字元的數量來衡量(即能夠在不滾動的情況下顯示這麼多個“M”字元)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_constant_outline_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **outline_size** = ``0`` :ref:`🔗<class_LineEdit_theme_constant_outline_size>`
|
||
|
||
文字輪廓的大小。
|
||
|
||
\ **注意:**\ 如果使用啟用了 :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` 的字形,其 :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` 必須至少設定為 :ref:`outline_size<class_LineEdit_theme_constant_outline_size>` 的\ *兩倍*\ ,輪廓算繪才能看起來正確。否則,輪廓可能會比預期的更早被切斷。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_font_font:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Font<class_Font>` **font** :ref:`🔗<class_LineEdit_theme_font_font>`
|
||
|
||
文字使用的字形。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_font_size_font_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **font_size** :ref:`🔗<class_LineEdit_theme_font_size_font_size>`
|
||
|
||
該 **LineEdit** 文字的字形大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_icon_clear:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **clear** :ref:`🔗<class_LineEdit_theme_icon_clear>`
|
||
|
||
“清除”按鈕的紋理。見 :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_style_focus:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **focus** :ref:`🔗<class_LineEdit_theme_style_focus>`
|
||
|
||
**LineEdit** 擁有 GUI 焦點時使用的背景。\ :ref:`focus<class_LineEdit_theme_style_focus>` :ref:`StyleBox<class_StyleBox>` 顯示在基礎 :ref:`StyleBox<class_StyleBox>` *之上*\ ,所以應該使用部分透明的 :ref:`StyleBox<class_StyleBox>`\ ,確保基礎 :ref:`StyleBox<class_StyleBox>` 仍然可見。代表輪廓或底線的 :ref:`StyleBox<class_StyleBox>` 可以很好地實作這個目的。要禁用聚焦的視覺效果,請指定 :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` 資源。請注意,禁用聚焦的視覺效果會影響使用鍵盤/手柄進行導覽的可用性,所以出於可存取性的原因,不建議這樣做。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_style_normal:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **normal** :ref:`🔗<class_LineEdit_theme_style_normal>`
|
||
|
||
該 **LineEdit** 的預設背景。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_LineEdit_theme_style_read_only:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **read_only** :ref:`🔗<class_LineEdit_theme_style_read_only>`
|
||
|
||
該 **LineEdit** 處於唯讀模式時使用的背景(\ :ref:`editable<class_LineEdit_property_editable>` 為 ``false``\ )。
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)`
|
||
.. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)`
|
||
.. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)`
|
||
.. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)`
|
||
.. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)`
|
||
.. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)`
|
||
.. |void| replace:: :abbr:`void (無回傳值。)`
|