class_lineedit.rst 79 KB

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