class_lineedit.rst 80 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803
  1. :github_url: hide
  2. .. meta::
  3. :keywords: text, input
  4. .. DO NOT EDIT THIS FILE!!!
  5. .. Generated automatically from Godot engine sources.
  6. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  7. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/LineEdit.xml.
  8. .. _class_LineEdit:
  9. LineEdit
  10. ========
  11. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  12. An input field for single-line text.
  13. .. rst-class:: classref-introduction-group
  14. Description
  15. -----------
  16. **LineEdit** provides an input field for editing a single line of text.
  17. - When the **LineEdit** control is focused using the keyboard arrow keys, it will only gain focus and not enter edit mode.
  18. - 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>`.
  19. - To exit edit mode, press ``ui_text_submit`` or ``ui_cancel`` (by default :kbd:`Escape`) actions.
  20. - 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.
  21. \ **Important:**\
  22. - 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).
  23. \ **LineEdit** features many built-in shortcuts that are always available (:kbd:`Ctrl` here maps to :kbd:`Cmd` on macOS):
  24. - :kbd:`Ctrl + C`: Copy
  25. - :kbd:`Ctrl + X`: Cut
  26. - :kbd:`Ctrl + V` or :kbd:`Ctrl + Y`: Paste/"yank"
  27. - :kbd:`Ctrl + Z`: Undo
  28. - :kbd:`Ctrl + ~`: Swap input direction.
  29. - :kbd:`Ctrl + Shift + Z`: Redo
  30. - :kbd:`Ctrl + U`: Delete text from the caret position to the beginning of the line
  31. - :kbd:`Ctrl + K`: Delete text from the caret position to the end of the line
  32. - :kbd:`Ctrl + A`: Select all text
  33. - :kbd:`Up Arrow`/:kbd:`Down Arrow`: Move the caret to the beginning/end of the line
  34. On macOS, some extra keyboard shortcuts are available:
  35. - :kbd:`Cmd + F`: Same as :kbd:`Right Arrow`, move the caret one character right
  36. - :kbd:`Cmd + B`: Same as :kbd:`Left Arrow`, move the caret one character left
  37. - :kbd:`Cmd + P`: Same as :kbd:`Up Arrow`, move the caret to the previous line
  38. - :kbd:`Cmd + N`: Same as :kbd:`Down Arrow`, move the caret to the next line
  39. - :kbd:`Cmd + D`: Same as :kbd:`Delete`, delete the character on the right side of caret
  40. - :kbd:`Cmd + H`: Same as :kbd:`Backspace`, delete the character on the left side of the caret
  41. - :kbd:`Cmd + A`: Same as :kbd:`Home`, move the caret to the beginning of the line
  42. - :kbd:`Cmd + E`: Same as :kbd:`End`, move the caret to the end of the line
  43. - :kbd:`Cmd + Left Arrow`: Same as :kbd:`Home`, move the caret to the beginning of the line
  44. - :kbd:`Cmd + Right Arrow`: Same as :kbd:`End`, move the caret to the end of the line
  45. \ **Note:** Caret movement shortcuts listed above are not affected by :ref:`shortcut_keys_enabled<class_LineEdit_property_shortcut_keys_enabled>`.
  46. .. rst-class:: classref-reftable-group
  47. Properties
  48. ----------
  49. .. table::
  50. :widths: auto
  51. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  52. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`alignment<class_LineEdit_property_alignment>` | ``0`` |
  53. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  54. | :ref:`bool<class_bool>` | :ref:`caret_blink<class_LineEdit_property_caret_blink>` | ``false`` |
  55. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  56. | :ref:`float<class_float>` | :ref:`caret_blink_interval<class_LineEdit_property_caret_blink_interval>` | ``0.65`` |
  57. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  58. | :ref:`int<class_int>` | :ref:`caret_column<class_LineEdit_property_caret_column>` | ``0`` |
  59. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  60. | :ref:`bool<class_bool>` | :ref:`caret_force_displayed<class_LineEdit_property_caret_force_displayed>` | ``false`` |
  61. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`caret_mid_grapheme<class_LineEdit_property_caret_mid_grapheme>` | ``false`` |
  63. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  64. | :ref:`bool<class_bool>` | :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>` | ``false`` |
  65. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  66. | :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_LineEdit_property_context_menu_enabled>` | ``true`` |
  67. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  68. | :ref:`bool<class_bool>` | :ref:`deselect_on_focus_loss_enabled<class_LineEdit_property_deselect_on_focus_loss_enabled>` | ``true`` |
  69. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  70. | :ref:`bool<class_bool>` | :ref:`drag_and_drop_selection_enabled<class_LineEdit_property_drag_and_drop_selection_enabled>` | ``true`` |
  71. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  72. | :ref:`bool<class_bool>` | :ref:`draw_control_chars<class_LineEdit_property_draw_control_chars>` | ``false`` |
  73. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  74. | :ref:`bool<class_bool>` | :ref:`editable<class_LineEdit_property_editable>` | ``true`` |
  75. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  76. | :ref:`bool<class_bool>` | :ref:`expand_to_text_length<class_LineEdit_property_expand_to_text_length>` | ``false`` |
  77. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  78. | :ref:`bool<class_bool>` | :ref:`flat<class_LineEdit_property_flat>` | ``false`` |
  79. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  80. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  81. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  82. | :ref:`bool<class_bool>` | :ref:`keep_editing_on_text_submit<class_LineEdit_property_keep_editing_on_text_submit>` | ``false`` |
  83. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  84. | :ref:`String<class_String>` | :ref:`language<class_LineEdit_property_language>` | ``""`` |
  85. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  86. | :ref:`int<class_int>` | :ref:`max_length<class_LineEdit_property_max_length>` | ``0`` |
  87. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  88. | :ref:`bool<class_bool>` | :ref:`middle_mouse_paste_enabled<class_LineEdit_property_middle_mouse_paste_enabled>` | ``true`` |
  89. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  90. | :ref:`CursorShape<enum_Control_CursorShape>` | mouse_default_cursor_shape | ``1`` (overrides :ref:`Control<class_Control_property_mouse_default_cursor_shape>`) |
  91. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  92. | :ref:`String<class_String>` | :ref:`placeholder_text<class_LineEdit_property_placeholder_text>` | ``""`` |
  93. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  94. | :ref:`Texture2D<class_Texture2D>` | :ref:`right_icon<class_LineEdit_property_right_icon>` | |
  95. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  96. | :ref:`bool<class_bool>` | :ref:`secret<class_LineEdit_property_secret>` | ``false`` |
  97. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  98. | :ref:`String<class_String>` | :ref:`secret_character<class_LineEdit_property_secret_character>` | ``"โ€ข"`` |
  99. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  100. | :ref:`bool<class_bool>` | :ref:`select_all_on_focus<class_LineEdit_property_select_all_on_focus>` | ``false`` |
  101. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  102. | :ref:`bool<class_bool>` | :ref:`selecting_enabled<class_LineEdit_property_selecting_enabled>` | ``true`` |
  103. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  104. | :ref:`bool<class_bool>` | :ref:`shortcut_keys_enabled<class_LineEdit_property_shortcut_keys_enabled>` | ``true`` |
  105. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  106. | :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_LineEdit_property_structured_text_bidi_override>` | ``0`` |
  107. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  108. | :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_LineEdit_property_structured_text_bidi_override_options>` | ``[]`` |
  109. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  110. | :ref:`String<class_String>` | :ref:`text<class_LineEdit_property_text>` | ``""`` |
  111. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  112. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`text_direction<class_LineEdit_property_text_direction>` | ``0`` |
  113. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  114. | :ref:`bool<class_bool>` | :ref:`virtual_keyboard_enabled<class_LineEdit_property_virtual_keyboard_enabled>` | ``true`` |
  115. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  116. | :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` | :ref:`virtual_keyboard_type<class_LineEdit_property_virtual_keyboard_type>` | ``0`` |
  117. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
  118. .. rst-class:: classref-reftable-group
  119. Methods
  120. -------
  121. .. table::
  122. :widths: auto
  123. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  124. | |void| | :ref:`apply_ime<class_LineEdit_method_apply_ime>`\ (\ ) |
  125. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  126. | |void| | :ref:`cancel_ime<class_LineEdit_method_cancel_ime>`\ (\ ) |
  127. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  128. | |void| | :ref:`clear<class_LineEdit_method_clear>`\ (\ ) |
  129. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  130. | |void| | :ref:`delete_char_at_caret<class_LineEdit_method_delete_char_at_caret>`\ (\ ) |
  131. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  132. | |void| | :ref:`delete_text<class_LineEdit_method_delete_text>`\ (\ from_column\: :ref:`int<class_int>`, to_column\: :ref:`int<class_int>`\ ) |
  133. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  134. | |void| | :ref:`deselect<class_LineEdit_method_deselect>`\ (\ ) |
  135. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  136. | |void| | :ref:`edit<class_LineEdit_method_edit>`\ (\ ) |
  137. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  138. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_LineEdit_method_get_menu>`\ (\ ) |const| |
  139. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  140. | :ref:`float<class_float>` | :ref:`get_scroll_offset<class_LineEdit_method_get_scroll_offset>`\ (\ ) |const| |
  141. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  142. | :ref:`String<class_String>` | :ref:`get_selected_text<class_LineEdit_method_get_selected_text>`\ (\ ) |
  143. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  144. | :ref:`int<class_int>` | :ref:`get_selection_from_column<class_LineEdit_method_get_selection_from_column>`\ (\ ) |const| |
  145. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  146. | :ref:`int<class_int>` | :ref:`get_selection_to_column<class_LineEdit_method_get_selection_to_column>`\ (\ ) |const| |
  147. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  148. | :ref:`bool<class_bool>` | :ref:`has_ime_text<class_LineEdit_method_has_ime_text>`\ (\ ) |const| |
  149. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  150. | :ref:`bool<class_bool>` | :ref:`has_redo<class_LineEdit_method_has_redo>`\ (\ ) |const| |
  151. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  152. | :ref:`bool<class_bool>` | :ref:`has_selection<class_LineEdit_method_has_selection>`\ (\ ) |const| |
  153. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  154. | :ref:`bool<class_bool>` | :ref:`has_undo<class_LineEdit_method_has_undo>`\ (\ ) |const| |
  155. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  156. | |void| | :ref:`insert_text_at_caret<class_LineEdit_method_insert_text_at_caret>`\ (\ text\: :ref:`String<class_String>`\ ) |
  157. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  158. | :ref:`bool<class_bool>` | :ref:`is_editing<class_LineEdit_method_is_editing>`\ (\ ) |const| |
  159. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  160. | :ref:`bool<class_bool>` | :ref:`is_menu_visible<class_LineEdit_method_is_menu_visible>`\ (\ ) |const| |
  161. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  162. | |void| | :ref:`menu_option<class_LineEdit_method_menu_option>`\ (\ option\: :ref:`int<class_int>`\ ) |
  163. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  164. | |void| | :ref:`select<class_LineEdit_method_select>`\ (\ from\: :ref:`int<class_int>` = 0, to\: :ref:`int<class_int>` = -1\ ) |
  165. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  166. | |void| | :ref:`select_all<class_LineEdit_method_select_all>`\ (\ ) |
  167. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  168. | |void| | :ref:`unedit<class_LineEdit_method_unedit>`\ (\ ) |
  169. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
  170. .. rst-class:: classref-reftable-group
  171. Theme Properties
  172. ----------------
  173. .. table::
  174. :widths: auto
  175. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  176. | :ref:`Color<class_Color>` | :ref:`caret_color<class_LineEdit_theme_color_caret_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  177. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  178. | :ref:`Color<class_Color>` | :ref:`clear_button_color<class_LineEdit_theme_color_clear_button_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  179. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  180. | :ref:`Color<class_Color>` | :ref:`clear_button_color_pressed<class_LineEdit_theme_color_clear_button_color_pressed>` | ``Color(1, 1, 1, 1)`` |
  181. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  182. | :ref:`Color<class_Color>` | :ref:`font_color<class_LineEdit_theme_color_font_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  183. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  184. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_LineEdit_theme_color_font_outline_color>` | ``Color(0, 0, 0, 1)`` |
  185. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  186. | :ref:`Color<class_Color>` | :ref:`font_placeholder_color<class_LineEdit_theme_color_font_placeholder_color>` | ``Color(0.875, 0.875, 0.875, 0.6)`` |
  187. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  188. | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_LineEdit_theme_color_font_selected_color>` | ``Color(1, 1, 1, 1)`` |
  189. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  190. | :ref:`Color<class_Color>` | :ref:`font_uneditable_color<class_LineEdit_theme_color_font_uneditable_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  191. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  192. | :ref:`Color<class_Color>` | :ref:`selection_color<class_LineEdit_theme_color_selection_color>` | ``Color(0.5, 0.5, 0.5, 1)`` |
  193. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  194. | :ref:`int<class_int>` | :ref:`caret_width<class_LineEdit_theme_constant_caret_width>` | ``1`` |
  195. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  196. | :ref:`int<class_int>` | :ref:`minimum_character_width<class_LineEdit_theme_constant_minimum_character_width>` | ``4`` |
  197. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  198. | :ref:`int<class_int>` | :ref:`outline_size<class_LineEdit_theme_constant_outline_size>` | ``0`` |
  199. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  200. | :ref:`Font<class_Font>` | :ref:`font<class_LineEdit_theme_font_font>` | |
  201. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  202. | :ref:`int<class_int>` | :ref:`font_size<class_LineEdit_theme_font_size_font_size>` | |
  203. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  204. | :ref:`Texture2D<class_Texture2D>` | :ref:`clear<class_LineEdit_theme_icon_clear>` | |
  205. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  206. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_LineEdit_theme_style_focus>` | |
  207. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  208. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_LineEdit_theme_style_normal>` | |
  209. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  210. | :ref:`StyleBox<class_StyleBox>` | :ref:`read_only<class_LineEdit_theme_style_read_only>` | |
  211. +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
  212. .. rst-class:: classref-section-separator
  213. ----
  214. .. rst-class:: classref-descriptions-group
  215. Signals
  216. -------
  217. .. _class_LineEdit_signal_editing_toggled:
  218. .. rst-class:: classref-signal
  219. **editing_toggled**\ (\ toggled_on\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_LineEdit_signal_editing_toggled>`
  220. Emitted when the **LineEdit** switches in or out of edit mode.
  221. .. rst-class:: classref-item-separator
  222. ----
  223. .. _class_LineEdit_signal_text_change_rejected:
  224. .. rst-class:: classref-signal
  225. **text_change_rejected**\ (\ rejected_substring\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_LineEdit_signal_text_change_rejected>`
  226. Emitted when appending text that overflows the :ref:`max_length<class_LineEdit_property_max_length>`. The appended text is truncated to fit :ref:`max_length<class_LineEdit_property_max_length>`, and the part that couldn't fit is passed as the ``rejected_substring`` argument.
  227. .. rst-class:: classref-item-separator
  228. ----
  229. .. _class_LineEdit_signal_text_changed:
  230. .. rst-class:: classref-signal
  231. **text_changed**\ (\ new_text\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_LineEdit_signal_text_changed>`
  232. Emitted when the text changes.
  233. .. rst-class:: classref-item-separator
  234. ----
  235. .. _class_LineEdit_signal_text_submitted:
  236. .. rst-class:: classref-signal
  237. **text_submitted**\ (\ new_text\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_LineEdit_signal_text_submitted>`
  238. Emitted when the user presses the ``ui_text_submit`` action (by default: :kbd:`Enter` or :kbd:`Kp Enter`) while the **LineEdit** has focus.
  239. .. rst-class:: classref-section-separator
  240. ----
  241. .. rst-class:: classref-descriptions-group
  242. Enumerations
  243. ------------
  244. .. _enum_LineEdit_MenuItems:
  245. .. rst-class:: classref-enumeration
  246. enum **MenuItems**: :ref:`๐Ÿ”—<enum_LineEdit_MenuItems>`
  247. .. _class_LineEdit_constant_MENU_CUT:
  248. .. rst-class:: classref-enumeration-constant
  249. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_CUT** = ``0``
  250. Cuts (copies and clears) the selected text.
  251. .. _class_LineEdit_constant_MENU_COPY:
  252. .. rst-class:: classref-enumeration-constant
  253. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_COPY** = ``1``
  254. Copies the selected text.
  255. .. _class_LineEdit_constant_MENU_PASTE:
  256. .. rst-class:: classref-enumeration-constant
  257. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_PASTE** = ``2``
  258. Pastes the clipboard text over the selected text (or at the caret's position).
  259. Non-printable escape characters are automatically stripped from the OS clipboard via :ref:`String.strip_escapes<class_String_method_strip_escapes>`.
  260. .. _class_LineEdit_constant_MENU_CLEAR:
  261. .. rst-class:: classref-enumeration-constant
  262. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_CLEAR** = ``3``
  263. Erases the whole **LineEdit** text.
  264. .. _class_LineEdit_constant_MENU_SELECT_ALL:
  265. .. rst-class:: classref-enumeration-constant
  266. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_SELECT_ALL** = ``4``
  267. Selects the whole **LineEdit** text.
  268. .. _class_LineEdit_constant_MENU_UNDO:
  269. .. rst-class:: classref-enumeration-constant
  270. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_UNDO** = ``5``
  271. Undoes the previous action.
  272. .. _class_LineEdit_constant_MENU_REDO:
  273. .. rst-class:: classref-enumeration-constant
  274. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_REDO** = ``6``
  275. Reverse the last undo action.
  276. .. _class_LineEdit_constant_MENU_SUBMENU_TEXT_DIR:
  277. .. rst-class:: classref-enumeration-constant
  278. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_SUBMENU_TEXT_DIR** = ``7``
  279. ID of "Text Writing Direction" submenu.
  280. .. _class_LineEdit_constant_MENU_DIR_INHERITED:
  281. .. rst-class:: classref-enumeration-constant
  282. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_INHERITED** = ``8``
  283. Sets text direction to inherited.
  284. .. _class_LineEdit_constant_MENU_DIR_AUTO:
  285. .. rst-class:: classref-enumeration-constant
  286. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_AUTO** = ``9``
  287. Sets text direction to automatic.
  288. .. _class_LineEdit_constant_MENU_DIR_LTR:
  289. .. rst-class:: classref-enumeration-constant
  290. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_LTR** = ``10``
  291. Sets text direction to left-to-right.
  292. .. _class_LineEdit_constant_MENU_DIR_RTL:
  293. .. rst-class:: classref-enumeration-constant
  294. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DIR_RTL** = ``11``
  295. Sets text direction to right-to-left.
  296. .. _class_LineEdit_constant_MENU_DISPLAY_UCC:
  297. .. rst-class:: classref-enumeration-constant
  298. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_DISPLAY_UCC** = ``12``
  299. Toggles control character display.
  300. .. _class_LineEdit_constant_MENU_SUBMENU_INSERT_UCC:
  301. .. rst-class:: classref-enumeration-constant
  302. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_SUBMENU_INSERT_UCC** = ``13``
  303. ID of "Insert Control Character" submenu.
  304. .. _class_LineEdit_constant_MENU_INSERT_LRM:
  305. .. rst-class:: classref-enumeration-constant
  306. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRM** = ``14``
  307. Inserts left-to-right mark (LRM) character.
  308. .. _class_LineEdit_constant_MENU_INSERT_RLM:
  309. .. rst-class:: classref-enumeration-constant
  310. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLM** = ``15``
  311. Inserts right-to-left mark (RLM) character.
  312. .. _class_LineEdit_constant_MENU_INSERT_LRE:
  313. .. rst-class:: classref-enumeration-constant
  314. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRE** = ``16``
  315. Inserts start of left-to-right embedding (LRE) character.
  316. .. _class_LineEdit_constant_MENU_INSERT_RLE:
  317. .. rst-class:: classref-enumeration-constant
  318. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLE** = ``17``
  319. Inserts start of right-to-left embedding (RLE) character.
  320. .. _class_LineEdit_constant_MENU_INSERT_LRO:
  321. .. rst-class:: classref-enumeration-constant
  322. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRO** = ``18``
  323. Inserts start of left-to-right override (LRO) character.
  324. .. _class_LineEdit_constant_MENU_INSERT_RLO:
  325. .. rst-class:: classref-enumeration-constant
  326. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLO** = ``19``
  327. Inserts start of right-to-left override (RLO) character.
  328. .. _class_LineEdit_constant_MENU_INSERT_PDF:
  329. .. rst-class:: classref-enumeration-constant
  330. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_PDF** = ``20``
  331. Inserts pop direction formatting (PDF) character.
  332. .. _class_LineEdit_constant_MENU_INSERT_ALM:
  333. .. rst-class:: classref-enumeration-constant
  334. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_ALM** = ``21``
  335. Inserts Arabic letter mark (ALM) character.
  336. .. _class_LineEdit_constant_MENU_INSERT_LRI:
  337. .. rst-class:: classref-enumeration-constant
  338. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_LRI** = ``22``
  339. Inserts left-to-right isolate (LRI) character.
  340. .. _class_LineEdit_constant_MENU_INSERT_RLI:
  341. .. rst-class:: classref-enumeration-constant
  342. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_RLI** = ``23``
  343. Inserts right-to-left isolate (RLI) character.
  344. .. _class_LineEdit_constant_MENU_INSERT_FSI:
  345. .. rst-class:: classref-enumeration-constant
  346. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_FSI** = ``24``
  347. Inserts first strong isolate (FSI) character.
  348. .. _class_LineEdit_constant_MENU_INSERT_PDI:
  349. .. rst-class:: classref-enumeration-constant
  350. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_PDI** = ``25``
  351. Inserts pop direction isolate (PDI) character.
  352. .. _class_LineEdit_constant_MENU_INSERT_ZWJ:
  353. .. rst-class:: classref-enumeration-constant
  354. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_ZWJ** = ``26``
  355. Inserts zero width joiner (ZWJ) character.
  356. .. _class_LineEdit_constant_MENU_INSERT_ZWNJ:
  357. .. rst-class:: classref-enumeration-constant
  358. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_ZWNJ** = ``27``
  359. Inserts zero width non-joiner (ZWNJ) character.
  360. .. _class_LineEdit_constant_MENU_INSERT_WJ:
  361. .. rst-class:: classref-enumeration-constant
  362. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_WJ** = ``28``
  363. Inserts word joiner (WJ) character.
  364. .. _class_LineEdit_constant_MENU_INSERT_SHY:
  365. .. rst-class:: classref-enumeration-constant
  366. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_INSERT_SHY** = ``29``
  367. Inserts soft hyphen (SHY) character.
  368. .. _class_LineEdit_constant_MENU_MAX:
  369. .. rst-class:: classref-enumeration-constant
  370. :ref:`MenuItems<enum_LineEdit_MenuItems>` **MENU_MAX** = ``30``
  371. Represents the size of the :ref:`MenuItems<enum_LineEdit_MenuItems>` enum.
  372. .. rst-class:: classref-item-separator
  373. ----
  374. .. _enum_LineEdit_VirtualKeyboardType:
  375. .. rst-class:: classref-enumeration
  376. enum **VirtualKeyboardType**: :ref:`๐Ÿ”—<enum_LineEdit_VirtualKeyboardType>`
  377. .. _class_LineEdit_constant_KEYBOARD_TYPE_DEFAULT:
  378. .. rst-class:: classref-enumeration-constant
  379. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_DEFAULT** = ``0``
  380. Default text virtual keyboard.
  381. .. _class_LineEdit_constant_KEYBOARD_TYPE_MULTILINE:
  382. .. rst-class:: classref-enumeration-constant
  383. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_MULTILINE** = ``1``
  384. Multiline virtual keyboard.
  385. .. _class_LineEdit_constant_KEYBOARD_TYPE_NUMBER:
  386. .. rst-class:: classref-enumeration-constant
  387. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER** = ``2``
  388. Virtual number keypad, useful for PIN entry.
  389. .. _class_LineEdit_constant_KEYBOARD_TYPE_NUMBER_DECIMAL:
  390. .. rst-class:: classref-enumeration-constant
  391. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_NUMBER_DECIMAL** = ``3``
  392. Virtual number keypad, useful for entering fractional numbers.
  393. .. _class_LineEdit_constant_KEYBOARD_TYPE_PHONE:
  394. .. rst-class:: classref-enumeration-constant
  395. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_PHONE** = ``4``
  396. Virtual phone number keypad.
  397. .. _class_LineEdit_constant_KEYBOARD_TYPE_EMAIL_ADDRESS:
  398. .. rst-class:: classref-enumeration-constant
  399. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_EMAIL_ADDRESS** = ``5``
  400. Virtual keyboard with additional keys to assist with typing email addresses.
  401. .. _class_LineEdit_constant_KEYBOARD_TYPE_PASSWORD:
  402. .. rst-class:: classref-enumeration-constant
  403. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_PASSWORD** = ``6``
  404. Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization.
  405. \ **Note:** This is not supported on Web. Instead, this behaves identically to :ref:`KEYBOARD_TYPE_DEFAULT<class_LineEdit_constant_KEYBOARD_TYPE_DEFAULT>`.
  406. .. _class_LineEdit_constant_KEYBOARD_TYPE_URL:
  407. .. rst-class:: classref-enumeration-constant
  408. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **KEYBOARD_TYPE_URL** = ``7``
  409. Virtual keyboard with additional keys to assist with typing URLs.
  410. .. rst-class:: classref-section-separator
  411. ----
  412. .. rst-class:: classref-descriptions-group
  413. Property Descriptions
  414. ---------------------
  415. .. _class_LineEdit_property_alignment:
  416. .. rst-class:: classref-property
  417. :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **alignment** = ``0`` :ref:`๐Ÿ”—<class_LineEdit_property_alignment>`
  418. .. rst-class:: classref-property-setget
  419. - |void| **set_horizontal_alignment**\ (\ value\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`\ )
  420. - :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_horizontal_alignment**\ (\ )
  421. Text alignment as defined in the :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` enum.
  422. .. rst-class:: classref-item-separator
  423. ----
  424. .. _class_LineEdit_property_caret_blink:
  425. .. rst-class:: classref-property
  426. :ref:`bool<class_bool>` **caret_blink** = ``false`` :ref:`๐Ÿ”—<class_LineEdit_property_caret_blink>`
  427. .. rst-class:: classref-property-setget
  428. - |void| **set_caret_blink_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  429. - :ref:`bool<class_bool>` **is_caret_blink_enabled**\ (\ )
  430. If ``true``, makes the caret blink.
  431. .. rst-class:: classref-item-separator
  432. ----
  433. .. _class_LineEdit_property_caret_blink_interval:
  434. .. rst-class:: classref-property
  435. :ref:`float<class_float>` **caret_blink_interval** = ``0.65`` :ref:`๐Ÿ”—<class_LineEdit_property_caret_blink_interval>`
  436. .. rst-class:: classref-property-setget
  437. - |void| **set_caret_blink_interval**\ (\ value\: :ref:`float<class_float>`\ )
  438. - :ref:`float<class_float>` **get_caret_blink_interval**\ (\ )
  439. The interval at which the caret blinks (in seconds).
  440. .. rst-class:: classref-item-separator
  441. ----
  442. .. _class_LineEdit_property_caret_column:
  443. .. rst-class:: classref-property
  444. :ref:`int<class_int>` **caret_column** = ``0`` :ref:`๐Ÿ”—<class_LineEdit_property_caret_column>`
  445. .. rst-class:: classref-property-setget
  446. - |void| **set_caret_column**\ (\ value\: :ref:`int<class_int>`\ )
  447. - :ref:`int<class_int>` **get_caret_column**\ (\ )
  448. The caret's column position inside the **LineEdit**. When set, the text may scroll to accommodate it.
  449. .. rst-class:: classref-item-separator
  450. ----
  451. .. _class_LineEdit_property_caret_force_displayed:
  452. .. rst-class:: classref-property
  453. :ref:`bool<class_bool>` **caret_force_displayed** = ``false`` :ref:`๐Ÿ”—<class_LineEdit_property_caret_force_displayed>`
  454. .. rst-class:: classref-property-setget
  455. - |void| **set_caret_force_displayed**\ (\ value\: :ref:`bool<class_bool>`\ )
  456. - :ref:`bool<class_bool>` **is_caret_force_displayed**\ (\ )
  457. If ``true``, the **LineEdit** will always show the caret, even if focus is lost.
  458. .. rst-class:: classref-item-separator
  459. ----
  460. .. _class_LineEdit_property_caret_mid_grapheme:
  461. .. rst-class:: classref-property
  462. :ref:`bool<class_bool>` **caret_mid_grapheme** = ``false`` :ref:`๐Ÿ”—<class_LineEdit_property_caret_mid_grapheme>`
  463. .. rst-class:: classref-property-setget
  464. - |void| **set_caret_mid_grapheme_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  465. - :ref:`bool<class_bool>` **is_caret_mid_grapheme_enabled**\ (\ )
  466. Allow moving caret, selecting and removing the individual composite character components.
  467. \ **Note:** :kbd:`Backspace` is always removing individual composite character components.
  468. .. rst-class:: classref-item-separator
  469. ----
  470. .. _class_LineEdit_property_clear_button_enabled:
  471. .. rst-class:: classref-property
  472. :ref:`bool<class_bool>` **clear_button_enabled** = ``false`` :ref:`๐Ÿ”—<class_LineEdit_property_clear_button_enabled>`
  473. .. rst-class:: classref-property-setget
  474. - |void| **set_clear_button_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  475. - :ref:`bool<class_bool>` **is_clear_button_enabled**\ (\ )
  476. If ``true``, the **LineEdit** will show a clear button if :ref:`text<class_LineEdit_property_text>` is not empty, which can be used to clear the text quickly.
  477. .. rst-class:: classref-item-separator
  478. ----
  479. .. _class_LineEdit_property_context_menu_enabled:
  480. .. rst-class:: classref-property
  481. :ref:`bool<class_bool>` **context_menu_enabled** = ``true`` :ref:`๐Ÿ”—<class_LineEdit_property_context_menu_enabled>`
  482. .. rst-class:: classref-property-setget
  483. - |void| **set_context_menu_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  484. - :ref:`bool<class_bool>` **is_context_menu_enabled**\ (\ )
  485. If ``true``, the context menu will appear when right-clicked.
  486. .. rst-class:: classref-item-separator
  487. ----
  488. .. _class_LineEdit_property_deselect_on_focus_loss_enabled:
  489. .. rst-class:: classref-property
  490. :ref:`bool<class_bool>` **deselect_on_focus_loss_enabled** = ``true`` :ref:`๐Ÿ”—<class_LineEdit_property_deselect_on_focus_loss_enabled>`
  491. .. rst-class:: classref-property-setget
  492. - |void| **set_deselect_on_focus_loss_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  493. - :ref:`bool<class_bool>` **is_deselect_on_focus_loss_enabled**\ (\ )
  494. If ``true``, the selected text will be deselected when focus is lost.
  495. .. rst-class:: classref-item-separator
  496. ----
  497. .. _class_LineEdit_property_drag_and_drop_selection_enabled:
  498. .. rst-class:: classref-property
  499. :ref:`bool<class_bool>` **drag_and_drop_selection_enabled** = ``true`` :ref:`๐Ÿ”—<class_LineEdit_property_drag_and_drop_selection_enabled>`
  500. .. rst-class:: classref-property-setget
  501. - |void| **set_drag_and_drop_selection_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  502. - :ref:`bool<class_bool>` **is_drag_and_drop_selection_enabled**\ (\ )
  503. If ``true``, allow drag and drop of selected text.
  504. .. rst-class:: classref-item-separator
  505. ----
  506. .. _class_LineEdit_property_draw_control_chars:
  507. .. rst-class:: classref-property
  508. :ref:`bool<class_bool>` **draw_control_chars** = ``false`` :ref:`๐Ÿ”—<class_LineEdit_property_draw_control_chars>`
  509. .. rst-class:: classref-property-setget
  510. - |void| **set_draw_control_chars**\ (\ value\: :ref:`bool<class_bool>`\ )
  511. - :ref:`bool<class_bool>` **get_draw_control_chars**\ (\ )
  512. If ``true``, control characters are displayed.
  513. .. rst-class:: classref-item-separator
  514. ----
  515. .. _class_LineEdit_property_editable:
  516. .. rst-class:: classref-property
  517. :ref:`bool<class_bool>` **editable** = ``true`` :ref:`๐Ÿ”—<class_LineEdit_property_editable>`
  518. .. rst-class:: classref-property-setget
  519. - |void| **set_editable**\ (\ value\: :ref:`bool<class_bool>`\ )
  520. - :ref:`bool<class_bool>` **is_editable**\ (\ )
  521. If ``false``, existing text cannot be modified and new text cannot be added.
  522. .. rst-class:: classref-item-separator
  523. ----
  524. .. _class_LineEdit_property_expand_to_text_length:
  525. .. rst-class:: classref-property
  526. :ref:`bool<class_bool>` **expand_to_text_length** = ``false`` :ref:`๐Ÿ”—<class_LineEdit_property_expand_to_text_length>`
  527. .. rst-class:: classref-property-setget
  528. - |void| **set_expand_to_text_length_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  529. - :ref:`bool<class_bool>` **is_expand_to_text_length_enabled**\ (\ )
  530. If ``true``, the **LineEdit** width will increase to stay longer than the :ref:`text<class_LineEdit_property_text>`. It will **not** compress if the :ref:`text<class_LineEdit_property_text>` is shortened.
  531. .. rst-class:: classref-item-separator
  532. ----
  533. .. _class_LineEdit_property_flat:
  534. .. rst-class:: classref-property
  535. :ref:`bool<class_bool>` **flat** = ``false`` :ref:`๐Ÿ”—<class_LineEdit_property_flat>`
  536. .. rst-class:: classref-property-setget
  537. - |void| **set_flat**\ (\ value\: :ref:`bool<class_bool>`\ )
  538. - :ref:`bool<class_bool>` **is_flat**\ (\ )
  539. If ``true``, the **LineEdit** doesn't display decoration.
  540. .. rst-class:: classref-item-separator
  541. ----
  542. .. _class_LineEdit_property_keep_editing_on_text_submit:
  543. .. rst-class:: classref-property
  544. :ref:`bool<class_bool>` **keep_editing_on_text_submit** = ``false`` :ref:`๐Ÿ”—<class_LineEdit_property_keep_editing_on_text_submit>`
  545. .. rst-class:: classref-property-setget
  546. - |void| **set_keep_editing_on_text_submit**\ (\ value\: :ref:`bool<class_bool>`\ )
  547. - :ref:`bool<class_bool>` **is_editing_kept_on_text_submit**\ (\ )
  548. 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`).
  549. .. rst-class:: classref-item-separator
  550. ----
  551. .. _class_LineEdit_property_language:
  552. .. rst-class:: classref-property
  553. :ref:`String<class_String>` **language** = ``""`` :ref:`๐Ÿ”—<class_LineEdit_property_language>`
  554. .. rst-class:: classref-property-setget
  555. - |void| **set_language**\ (\ value\: :ref:`String<class_String>`\ )
  556. - :ref:`String<class_String>` **get_language**\ (\ )
  557. Language code used for line-breaking and text shaping algorithms. If left empty, current locale is used instead.
  558. .. rst-class:: classref-item-separator
  559. ----
  560. .. _class_LineEdit_property_max_length:
  561. .. rst-class:: classref-property
  562. :ref:`int<class_int>` **max_length** = ``0`` :ref:`๐Ÿ”—<class_LineEdit_property_max_length>`
  563. .. rst-class:: classref-property-setget
  564. - |void| **set_max_length**\ (\ value\: :ref:`int<class_int>`\ )
  565. - :ref:`int<class_int>` **get_max_length**\ (\ )
  566. Maximum number of characters that can be entered inside the **LineEdit**. If ``0``, there is no limit.
  567. 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.
  568. 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 parameter:
  569. .. tabs::
  570. .. code-tab:: gdscript
  571. text = "Hello world"
  572. max_length = 5
  573. # `text` becomes "Hello".
  574. max_length = 10
  575. text += " goodbye"
  576. # `text` becomes "Hello good".
  577. # `text_change_rejected` is emitted with "bye" as parameter.
  578. .. code-tab:: csharp
  579. Text = "Hello world";
  580. MaxLength = 5;
  581. // `Text` becomes "Hello".
  582. MaxLength = 10;
  583. Text += " goodbye";
  584. // `Text` becomes "Hello good".
  585. // `text_change_rejected` is emitted with "bye" as parameter.
  586. .. rst-class:: classref-item-separator
  587. ----
  588. .. _class_LineEdit_property_middle_mouse_paste_enabled:
  589. .. rst-class:: classref-property
  590. :ref:`bool<class_bool>` **middle_mouse_paste_enabled** = ``true`` :ref:`๐Ÿ”—<class_LineEdit_property_middle_mouse_paste_enabled>`
  591. .. rst-class:: classref-property-setget
  592. - |void| **set_middle_mouse_paste_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  593. - :ref:`bool<class_bool>` **is_middle_mouse_paste_enabled**\ (\ )
  594. If ``false``, using middle mouse button to paste clipboard will be disabled.
  595. \ **Note:** This method is only implemented on Linux.
  596. .. rst-class:: classref-item-separator
  597. ----
  598. .. _class_LineEdit_property_placeholder_text:
  599. .. rst-class:: classref-property
  600. :ref:`String<class_String>` **placeholder_text** = ``""`` :ref:`๐Ÿ”—<class_LineEdit_property_placeholder_text>`
  601. .. rst-class:: classref-property-setget
  602. - |void| **set_placeholder**\ (\ value\: :ref:`String<class_String>`\ )
  603. - :ref:`String<class_String>` **get_placeholder**\ (\ )
  604. Text shown when the **LineEdit** is empty. It is **not** the **LineEdit**'s default value (see :ref:`text<class_LineEdit_property_text>`).
  605. .. rst-class:: classref-item-separator
  606. ----
  607. .. _class_LineEdit_property_right_icon:
  608. .. rst-class:: classref-property
  609. :ref:`Texture2D<class_Texture2D>` **right_icon** :ref:`๐Ÿ”—<class_LineEdit_property_right_icon>`
  610. .. rst-class:: classref-property-setget
  611. - |void| **set_right_icon**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
  612. - :ref:`Texture2D<class_Texture2D>` **get_right_icon**\ (\ )
  613. Sets the icon that will appear in the right end of the **LineEdit** if there's no :ref:`text<class_LineEdit_property_text>`, or always, if :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>` is set to ``false``.
  614. .. rst-class:: classref-item-separator
  615. ----
  616. .. _class_LineEdit_property_secret:
  617. .. rst-class:: classref-property
  618. :ref:`bool<class_bool>` **secret** = ``false`` :ref:`๐Ÿ”—<class_LineEdit_property_secret>`
  619. .. rst-class:: classref-property-setget
  620. - |void| **set_secret**\ (\ value\: :ref:`bool<class_bool>`\ )
  621. - :ref:`bool<class_bool>` **is_secret**\ (\ )
  622. If ``true``, every character is replaced with the secret character (see :ref:`secret_character<class_LineEdit_property_secret_character>`).
  623. .. rst-class:: classref-item-separator
  624. ----
  625. .. _class_LineEdit_property_secret_character:
  626. .. rst-class:: classref-property
  627. :ref:`String<class_String>` **secret_character** = ``"โ€ข"`` :ref:`๐Ÿ”—<class_LineEdit_property_secret_character>`
  628. .. rst-class:: classref-property-setget
  629. - |void| **set_secret_character**\ (\ value\: :ref:`String<class_String>`\ )
  630. - :ref:`String<class_String>` **get_secret_character**\ (\ )
  631. 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.
  632. .. rst-class:: classref-item-separator
  633. ----
  634. .. _class_LineEdit_property_select_all_on_focus:
  635. .. rst-class:: classref-property
  636. :ref:`bool<class_bool>` **select_all_on_focus** = ``false`` :ref:`๐Ÿ”—<class_LineEdit_property_select_all_on_focus>`
  637. .. rst-class:: classref-property-setget
  638. - |void| **set_select_all_on_focus**\ (\ value\: :ref:`bool<class_bool>`\ )
  639. - :ref:`bool<class_bool>` **is_select_all_on_focus**\ (\ )
  640. If ``true``, the **LineEdit** will select the whole text when it gains focus.
  641. .. rst-class:: classref-item-separator
  642. ----
  643. .. _class_LineEdit_property_selecting_enabled:
  644. .. rst-class:: classref-property
  645. :ref:`bool<class_bool>` **selecting_enabled** = ``true`` :ref:`๐Ÿ”—<class_LineEdit_property_selecting_enabled>`
  646. .. rst-class:: classref-property-setget
  647. - |void| **set_selecting_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  648. - :ref:`bool<class_bool>` **is_selecting_enabled**\ (\ )
  649. If ``false``, it's impossible to select the text using mouse nor keyboard.
  650. .. rst-class:: classref-item-separator
  651. ----
  652. .. _class_LineEdit_property_shortcut_keys_enabled:
  653. .. rst-class:: classref-property
  654. :ref:`bool<class_bool>` **shortcut_keys_enabled** = ``true`` :ref:`๐Ÿ”—<class_LineEdit_property_shortcut_keys_enabled>`
  655. .. rst-class:: classref-property-setget
  656. - |void| **set_shortcut_keys_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  657. - :ref:`bool<class_bool>` **is_shortcut_keys_enabled**\ (\ )
  658. If ``true``, shortcut keys for context menu items are enabled, even if the context menu is disabled.
  659. .. rst-class:: classref-item-separator
  660. ----
  661. .. _class_LineEdit_property_structured_text_bidi_override:
  662. .. rst-class:: classref-property
  663. :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **structured_text_bidi_override** = ``0`` :ref:`๐Ÿ”—<class_LineEdit_property_structured_text_bidi_override>`
  664. .. rst-class:: classref-property-setget
  665. - |void| **set_structured_text_bidi_override**\ (\ value\: :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>`\ )
  666. - :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **get_structured_text_bidi_override**\ (\ )
  667. Set BiDi algorithm override for the structured text.
  668. .. rst-class:: classref-item-separator
  669. ----
  670. .. _class_LineEdit_property_structured_text_bidi_override_options:
  671. .. rst-class:: classref-property
  672. :ref:`Array<class_Array>` **structured_text_bidi_override_options** = ``[]`` :ref:`๐Ÿ”—<class_LineEdit_property_structured_text_bidi_override_options>`
  673. .. rst-class:: classref-property-setget
  674. - |void| **set_structured_text_bidi_override_options**\ (\ value\: :ref:`Array<class_Array>`\ )
  675. - :ref:`Array<class_Array>` **get_structured_text_bidi_override_options**\ (\ )
  676. Set additional options for BiDi override.
  677. .. rst-class:: classref-item-separator
  678. ----
  679. .. _class_LineEdit_property_text:
  680. .. rst-class:: classref-property
  681. :ref:`String<class_String>` **text** = ``""`` :ref:`๐Ÿ”—<class_LineEdit_property_text>`
  682. .. rst-class:: classref-property-setget
  683. - |void| **set_text**\ (\ value\: :ref:`String<class_String>`\ )
  684. - :ref:`String<class_String>` **get_text**\ (\ )
  685. String value of the **LineEdit**.
  686. \ **Note:** Changing text using this property won't emit the :ref:`text_changed<class_LineEdit_signal_text_changed>` signal.
  687. .. rst-class:: classref-item-separator
  688. ----
  689. .. _class_LineEdit_property_text_direction:
  690. .. rst-class:: classref-property
  691. :ref:`TextDirection<enum_Control_TextDirection>` **text_direction** = ``0`` :ref:`๐Ÿ”—<class_LineEdit_property_text_direction>`
  692. .. rst-class:: classref-property-setget
  693. - |void| **set_text_direction**\ (\ value\: :ref:`TextDirection<enum_Control_TextDirection>`\ )
  694. - :ref:`TextDirection<enum_Control_TextDirection>` **get_text_direction**\ (\ )
  695. Base text writing direction.
  696. .. rst-class:: classref-item-separator
  697. ----
  698. .. _class_LineEdit_property_virtual_keyboard_enabled:
  699. .. rst-class:: classref-property
  700. :ref:`bool<class_bool>` **virtual_keyboard_enabled** = ``true`` :ref:`๐Ÿ”—<class_LineEdit_property_virtual_keyboard_enabled>`
  701. .. rst-class:: classref-property-setget
  702. - |void| **set_virtual_keyboard_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  703. - :ref:`bool<class_bool>` **is_virtual_keyboard_enabled**\ (\ )
  704. If ``true``, the native virtual keyboard is shown when focused on platforms that support it.
  705. .. rst-class:: classref-item-separator
  706. ----
  707. .. _class_LineEdit_property_virtual_keyboard_type:
  708. .. rst-class:: classref-property
  709. :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **virtual_keyboard_type** = ``0`` :ref:`๐Ÿ”—<class_LineEdit_property_virtual_keyboard_type>`
  710. .. rst-class:: classref-property-setget
  711. - |void| **set_virtual_keyboard_type**\ (\ value\: :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>`\ )
  712. - :ref:`VirtualKeyboardType<enum_LineEdit_VirtualKeyboardType>` **get_virtual_keyboard_type**\ (\ )
  713. Specifies the type of virtual keyboard to show.
  714. .. rst-class:: classref-section-separator
  715. ----
  716. .. rst-class:: classref-descriptions-group
  717. Method Descriptions
  718. -------------------
  719. .. _class_LineEdit_method_apply_ime:
  720. .. rst-class:: classref-method
  721. |void| **apply_ime**\ (\ ) :ref:`๐Ÿ”—<class_LineEdit_method_apply_ime>`
  722. Applies text from the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ (IME) and closes the IME if it is open.
  723. .. rst-class:: classref-item-separator
  724. ----
  725. .. _class_LineEdit_method_cancel_ime:
  726. .. rst-class:: classref-method
  727. |void| **cancel_ime**\ (\ ) :ref:`๐Ÿ”—<class_LineEdit_method_cancel_ime>`
  728. 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.
  729. .. rst-class:: classref-item-separator
  730. ----
  731. .. _class_LineEdit_method_clear:
  732. .. rst-class:: classref-method
  733. |void| **clear**\ (\ ) :ref:`๐Ÿ”—<class_LineEdit_method_clear>`
  734. Erases the **LineEdit**'s :ref:`text<class_LineEdit_property_text>`.
  735. .. rst-class:: classref-item-separator
  736. ----
  737. .. _class_LineEdit_method_delete_char_at_caret:
  738. .. rst-class:: classref-method
  739. |void| **delete_char_at_caret**\ (\ ) :ref:`๐Ÿ”—<class_LineEdit_method_delete_char_at_caret>`
  740. Deletes one character at the caret's current position (equivalent to pressing :kbd:`Delete`).
  741. .. rst-class:: classref-item-separator
  742. ----
  743. .. _class_LineEdit_method_delete_text:
  744. .. rst-class:: classref-method
  745. |void| **delete_text**\ (\ from_column\: :ref:`int<class_int>`, to_column\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_LineEdit_method_delete_text>`
  746. Deletes a section of the :ref:`text<class_LineEdit_property_text>` going from position ``from_column`` to ``to_column``. Both parameters should be within the text's length.
  747. .. rst-class:: classref-item-separator
  748. ----
  749. .. _class_LineEdit_method_deselect:
  750. .. rst-class:: classref-method
  751. |void| **deselect**\ (\ ) :ref:`๐Ÿ”—<class_LineEdit_method_deselect>`
  752. Clears the current selection.
  753. .. rst-class:: classref-item-separator
  754. ----
  755. .. _class_LineEdit_method_edit:
  756. .. rst-class:: classref-method
  757. |void| **edit**\ (\ ) :ref:`๐Ÿ”—<class_LineEdit_method_edit>`
  758. Allows entering edit mode whether the **LineEdit** is focused or not.
  759. See also :ref:`keep_editing_on_text_submit<class_LineEdit_property_keep_editing_on_text_submit>`.
  760. .. rst-class:: classref-item-separator
  761. ----
  762. .. _class_LineEdit_method_get_menu:
  763. .. rst-class:: classref-method
  764. :ref:`PopupMenu<class_PopupMenu>` **get_menu**\ (\ ) |const| :ref:`๐Ÿ”—<class_LineEdit_method_get_menu>`
  765. Returns the :ref:`PopupMenu<class_PopupMenu>` of this **LineEdit**. By default, this menu is displayed when right-clicking on the **LineEdit**.
  766. You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see :ref:`MenuItems<enum_LineEdit_MenuItems>`). For example:
  767. .. tabs::
  768. .. code-tab:: gdscript
  769. func _ready():
  770. var menu = get_menu()
  771. # Remove all items after "Redo".
  772. menu.item_count = menu.get_item_index(MENU_REDO) + 1
  773. # Add custom items.
  774. menu.add_separator()
  775. menu.add_item("Insert Date", MENU_MAX + 1)
  776. # Connect callback.
  777. menu.id_pressed.connect(_on_item_pressed)
  778. func _on_item_pressed(id):
  779. if id == MENU_MAX + 1:
  780. insert_text_at_caret(Time.get_date_string_from_system())
  781. .. code-tab:: csharp
  782. public override void _Ready()
  783. {
  784. var menu = GetMenu();
  785. // Remove all items after "Redo".
  786. menu.ItemCount = menu.GetItemIndex(LineEdit.MenuItems.Redo) + 1;
  787. // Add custom items.
  788. menu.AddSeparator();
  789. menu.AddItem("Insert Date", LineEdit.MenuItems.Max + 1);
  790. // Add event handler.
  791. menu.IdPressed += OnItemPressed;
  792. }
  793. public void OnItemPressed(int id)
  794. {
  795. if (id == LineEdit.MenuItems.Max + 1)
  796. {
  797. InsertTextAtCaret(Time.GetDateStringFromSystem());
  798. }
  799. }
  800. \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`Window.visible<class_Window_property_visible>` property.
  801. .. rst-class:: classref-item-separator
  802. ----
  803. .. _class_LineEdit_method_get_scroll_offset:
  804. .. rst-class:: classref-method
  805. :ref:`float<class_float>` **get_scroll_offset**\ (\ ) |const| :ref:`๐Ÿ”—<class_LineEdit_method_get_scroll_offset>`
  806. Returns the scroll offset due to :ref:`caret_column<class_LineEdit_property_caret_column>`, as a number of characters.
  807. .. rst-class:: classref-item-separator
  808. ----
  809. .. _class_LineEdit_method_get_selected_text:
  810. .. rst-class:: classref-method
  811. :ref:`String<class_String>` **get_selected_text**\ (\ ) :ref:`๐Ÿ”—<class_LineEdit_method_get_selected_text>`
  812. Returns the text inside the selection.
  813. .. rst-class:: classref-item-separator
  814. ----
  815. .. _class_LineEdit_method_get_selection_from_column:
  816. .. rst-class:: classref-method
  817. :ref:`int<class_int>` **get_selection_from_column**\ (\ ) |const| :ref:`๐Ÿ”—<class_LineEdit_method_get_selection_from_column>`
  818. Returns the selection begin column.
  819. .. rst-class:: classref-item-separator
  820. ----
  821. .. _class_LineEdit_method_get_selection_to_column:
  822. .. rst-class:: classref-method
  823. :ref:`int<class_int>` **get_selection_to_column**\ (\ ) |const| :ref:`๐Ÿ”—<class_LineEdit_method_get_selection_to_column>`
  824. Returns the selection end column.
  825. .. rst-class:: classref-item-separator
  826. ----
  827. .. _class_LineEdit_method_has_ime_text:
  828. .. rst-class:: classref-method
  829. :ref:`bool<class_bool>` **has_ime_text**\ (\ ) |const| :ref:`๐Ÿ”—<class_LineEdit_method_has_ime_text>`
  830. Returns ``true`` if the user has text in the `Input Method Editor <https://en.wikipedia.org/wiki/Input_method>`__ (IME).
  831. .. rst-class:: classref-item-separator
  832. ----
  833. .. _class_LineEdit_method_has_redo:
  834. .. rst-class:: classref-method
  835. :ref:`bool<class_bool>` **has_redo**\ (\ ) |const| :ref:`๐Ÿ”—<class_LineEdit_method_has_redo>`
  836. Returns ``true`` if a "redo" action is available.
  837. .. rst-class:: classref-item-separator
  838. ----
  839. .. _class_LineEdit_method_has_selection:
  840. .. rst-class:: classref-method
  841. :ref:`bool<class_bool>` **has_selection**\ (\ ) |const| :ref:`๐Ÿ”—<class_LineEdit_method_has_selection>`
  842. Returns ``true`` if the user has selected text.
  843. .. rst-class:: classref-item-separator
  844. ----
  845. .. _class_LineEdit_method_has_undo:
  846. .. rst-class:: classref-method
  847. :ref:`bool<class_bool>` **has_undo**\ (\ ) |const| :ref:`๐Ÿ”—<class_LineEdit_method_has_undo>`
  848. Returns ``true`` if an "undo" action is available.
  849. .. rst-class:: classref-item-separator
  850. ----
  851. .. _class_LineEdit_method_insert_text_at_caret:
  852. .. rst-class:: classref-method
  853. |void| **insert_text_at_caret**\ (\ text\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_LineEdit_method_insert_text_at_caret>`
  854. Inserts ``text`` at the caret. If the resulting value is longer than :ref:`max_length<class_LineEdit_property_max_length>`, nothing happens.
  855. .. rst-class:: classref-item-separator
  856. ----
  857. .. _class_LineEdit_method_is_editing:
  858. .. rst-class:: classref-method
  859. :ref:`bool<class_bool>` **is_editing**\ (\ ) |const| :ref:`๐Ÿ”—<class_LineEdit_method_is_editing>`
  860. Returns whether the **LineEdit** is being edited.
  861. .. rst-class:: classref-item-separator
  862. ----
  863. .. _class_LineEdit_method_is_menu_visible:
  864. .. rst-class:: classref-method
  865. :ref:`bool<class_bool>` **is_menu_visible**\ (\ ) |const| :ref:`๐Ÿ”—<class_LineEdit_method_is_menu_visible>`
  866. Returns whether the menu is visible. Use this instead of ``get_menu().visible`` to improve performance (so the creation of the menu is avoided).
  867. .. rst-class:: classref-item-separator
  868. ----
  869. .. _class_LineEdit_method_menu_option:
  870. .. rst-class:: classref-method
  871. |void| **menu_option**\ (\ option\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_LineEdit_method_menu_option>`
  872. Executes a given action as defined in the :ref:`MenuItems<enum_LineEdit_MenuItems>` enum.
  873. .. rst-class:: classref-item-separator
  874. ----
  875. .. _class_LineEdit_method_select:
  876. .. rst-class:: classref-method
  877. |void| **select**\ (\ from\: :ref:`int<class_int>` = 0, to\: :ref:`int<class_int>` = -1\ ) :ref:`๐Ÿ”—<class_LineEdit_method_select>`
  878. Selects characters inside **LineEdit** between ``from`` and ``to``. By default, ``from`` is at the beginning and ``to`` at the end.
  879. .. tabs::
  880. .. code-tab:: gdscript
  881. text = "Welcome"
  882. select() # Will select "Welcome".
  883. select(4) # Will select "ome".
  884. select(2, 5) # Will select "lco".
  885. .. code-tab:: csharp
  886. Text = "Welcome";
  887. Select(); // Will select "Welcome".
  888. Select(4); // Will select "ome".
  889. Select(2, 5); // Will select "lco".
  890. .. rst-class:: classref-item-separator
  891. ----
  892. .. _class_LineEdit_method_select_all:
  893. .. rst-class:: classref-method
  894. |void| **select_all**\ (\ ) :ref:`๐Ÿ”—<class_LineEdit_method_select_all>`
  895. Selects the whole :ref:`String<class_String>`.
  896. .. rst-class:: classref-item-separator
  897. ----
  898. .. _class_LineEdit_method_unedit:
  899. .. rst-class:: classref-method
  900. |void| **unedit**\ (\ ) :ref:`๐Ÿ”—<class_LineEdit_method_unedit>`
  901. Allows exiting edit mode while preserving focus.
  902. .. rst-class:: classref-section-separator
  903. ----
  904. .. rst-class:: classref-descriptions-group
  905. Theme Property Descriptions
  906. ---------------------------
  907. .. _class_LineEdit_theme_color_caret_color:
  908. .. rst-class:: classref-themeproperty
  909. :ref:`Color<class_Color>` **caret_color** = ``Color(0.95, 0.95, 0.95, 1)`` :ref:`๐Ÿ”—<class_LineEdit_theme_color_caret_color>`
  910. Color of the **LineEdit**'s caret (text cursor). This can be set to a fully transparent color to hide the caret entirely.
  911. .. rst-class:: classref-item-separator
  912. ----
  913. .. _class_LineEdit_theme_color_clear_button_color:
  914. .. rst-class:: classref-themeproperty
  915. :ref:`Color<class_Color>` **clear_button_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`๐Ÿ”—<class_LineEdit_theme_color_clear_button_color>`
  916. Color used as default tint for the clear button.
  917. .. rst-class:: classref-item-separator
  918. ----
  919. .. _class_LineEdit_theme_color_clear_button_color_pressed:
  920. .. rst-class:: classref-themeproperty
  921. :ref:`Color<class_Color>` **clear_button_color_pressed** = ``Color(1, 1, 1, 1)`` :ref:`๐Ÿ”—<class_LineEdit_theme_color_clear_button_color_pressed>`
  922. Color used for the clear button when it's pressed.
  923. .. rst-class:: classref-item-separator
  924. ----
  925. .. _class_LineEdit_theme_color_font_color:
  926. .. rst-class:: classref-themeproperty
  927. :ref:`Color<class_Color>` **font_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`๐Ÿ”—<class_LineEdit_theme_color_font_color>`
  928. Default font color.
  929. .. rst-class:: classref-item-separator
  930. ----
  931. .. _class_LineEdit_theme_color_font_outline_color:
  932. .. rst-class:: classref-themeproperty
  933. :ref:`Color<class_Color>` **font_outline_color** = ``Color(0, 0, 0, 1)`` :ref:`๐Ÿ”—<class_LineEdit_theme_color_font_outline_color>`
  934. The tint of text outline of the **LineEdit**.
  935. .. rst-class:: classref-item-separator
  936. ----
  937. .. _class_LineEdit_theme_color_font_placeholder_color:
  938. .. rst-class:: classref-themeproperty
  939. :ref:`Color<class_Color>` **font_placeholder_color** = ``Color(0.875, 0.875, 0.875, 0.6)`` :ref:`๐Ÿ”—<class_LineEdit_theme_color_font_placeholder_color>`
  940. Font color for :ref:`placeholder_text<class_LineEdit_property_placeholder_text>`.
  941. .. rst-class:: classref-item-separator
  942. ----
  943. .. _class_LineEdit_theme_color_font_selected_color:
  944. .. rst-class:: classref-themeproperty
  945. :ref:`Color<class_Color>` **font_selected_color** = ``Color(1, 1, 1, 1)`` :ref:`๐Ÿ”—<class_LineEdit_theme_color_font_selected_color>`
  946. Font color for selected text (inside the selection rectangle).
  947. .. rst-class:: classref-item-separator
  948. ----
  949. .. _class_LineEdit_theme_color_font_uneditable_color:
  950. .. rst-class:: classref-themeproperty
  951. :ref:`Color<class_Color>` **font_uneditable_color** = ``Color(0.875, 0.875, 0.875, 0.5)`` :ref:`๐Ÿ”—<class_LineEdit_theme_color_font_uneditable_color>`
  952. Font color when editing is disabled.
  953. .. rst-class:: classref-item-separator
  954. ----
  955. .. _class_LineEdit_theme_color_selection_color:
  956. .. rst-class:: classref-themeproperty
  957. :ref:`Color<class_Color>` **selection_color** = ``Color(0.5, 0.5, 0.5, 1)`` :ref:`๐Ÿ”—<class_LineEdit_theme_color_selection_color>`
  958. Color of the selection rectangle.
  959. .. rst-class:: classref-item-separator
  960. ----
  961. .. _class_LineEdit_theme_constant_caret_width:
  962. .. rst-class:: classref-themeproperty
  963. :ref:`int<class_int>` **caret_width** = ``1`` :ref:`๐Ÿ”—<class_LineEdit_theme_constant_caret_width>`
  964. The caret's width in pixels. Greater values can be used to improve accessibility by ensuring the caret is easily visible, or to ensure consistency with a large font size.
  965. .. rst-class:: classref-item-separator
  966. ----
  967. .. _class_LineEdit_theme_constant_minimum_character_width:
  968. .. rst-class:: classref-themeproperty
  969. :ref:`int<class_int>` **minimum_character_width** = ``4`` :ref:`๐Ÿ”—<class_LineEdit_theme_constant_minimum_character_width>`
  970. Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of 'M' characters (i.e. this number of 'M' characters can be displayed without scrolling).
  971. .. rst-class:: classref-item-separator
  972. ----
  973. .. _class_LineEdit_theme_constant_outline_size:
  974. .. rst-class:: classref-themeproperty
  975. :ref:`int<class_int>` **outline_size** = ``0`` :ref:`๐Ÿ”—<class_LineEdit_theme_constant_outline_size>`
  976. The size of the text outline.
  977. \ **Note:** If using a font with :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` enabled, its :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least *twice* the value of :ref:`outline_size<class_LineEdit_theme_constant_outline_size>` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
  978. .. rst-class:: classref-item-separator
  979. ----
  980. .. _class_LineEdit_theme_font_font:
  981. .. rst-class:: classref-themeproperty
  982. :ref:`Font<class_Font>` **font** :ref:`๐Ÿ”—<class_LineEdit_theme_font_font>`
  983. Font used for the text.
  984. .. rst-class:: classref-item-separator
  985. ----
  986. .. _class_LineEdit_theme_font_size_font_size:
  987. .. rst-class:: classref-themeproperty
  988. :ref:`int<class_int>` **font_size** :ref:`๐Ÿ”—<class_LineEdit_theme_font_size_font_size>`
  989. Font size of the **LineEdit**'s text.
  990. .. rst-class:: classref-item-separator
  991. ----
  992. .. _class_LineEdit_theme_icon_clear:
  993. .. rst-class:: classref-themeproperty
  994. :ref:`Texture2D<class_Texture2D>` **clear** :ref:`๐Ÿ”—<class_LineEdit_theme_icon_clear>`
  995. Texture for the clear button. See :ref:`clear_button_enabled<class_LineEdit_property_clear_button_enabled>`.
  996. .. rst-class:: classref-item-separator
  997. ----
  998. .. _class_LineEdit_theme_style_focus:
  999. .. rst-class:: classref-themeproperty
  1000. :ref:`StyleBox<class_StyleBox>` **focus** :ref:`๐Ÿ”—<class_LineEdit_theme_style_focus>`
  1001. Background used when **LineEdit** has GUI focus. The :ref:`focus<class_LineEdit_theme_style_focus>` :ref:`StyleBox<class_StyleBox>` is displayed *over* the base :ref:`StyleBox<class_StyleBox>`, so a partially transparent :ref:`StyleBox<class_StyleBox>` should be used to ensure the base :ref:`StyleBox<class_StyleBox>` remains visible. A :ref:`StyleBox<class_StyleBox>` that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
  1002. .. rst-class:: classref-item-separator
  1003. ----
  1004. .. _class_LineEdit_theme_style_normal:
  1005. .. rst-class:: classref-themeproperty
  1006. :ref:`StyleBox<class_StyleBox>` **normal** :ref:`๐Ÿ”—<class_LineEdit_theme_style_normal>`
  1007. Default background for the **LineEdit**.
  1008. .. rst-class:: classref-item-separator
  1009. ----
  1010. .. _class_LineEdit_theme_style_read_only:
  1011. .. rst-class:: classref-themeproperty
  1012. :ref:`StyleBox<class_StyleBox>` **read_only** :ref:`๐Ÿ”—<class_LineEdit_theme_style_read_only>`
  1013. Background used when **LineEdit** is in read-only mode (:ref:`editable<class_LineEdit_property_editable>` is set to ``false``).
  1014. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1015. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1016. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1017. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1018. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1019. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  1020. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  1021. .. |void| replace:: :abbr:`void (No return value.)`