class_lineedit.rst 76 KB

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