class_lineedit.rst 77 KB

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