mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-03 05:48:42 +03:00
2544 lines
158 KiB
ReStructuredText
2544 lines
158 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the TextEdit.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_TextEdit:
|
|
|
|
TextEdit
|
|
========
|
|
|
|
**Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
**Inherited By:** :ref:`CodeEdit<class_CodeEdit>`
|
|
|
|
Multiline text editing control.
|
|
|
|
Description
|
|
-----------
|
|
|
|
TextEdit is meant for editing large, multiline text. It also has facilities for editing code, such as syntax highlighting support and multiple levels of undo/redo.
|
|
|
|
\ **Note:** When holding down :kbd:`Alt`, the vertical scroll wheel will scroll 5 times as fast as it would normally do. This also works in the Godot script editor.
|
|
|
|
Properties
|
|
----------
|
|
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`caret_blink<class_TextEdit_property_caret_blink>` | ``false`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`caret_blink_speed<class_TextEdit_property_caret_blink_speed>` | ``0.65`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`caret_mid_grapheme<class_TextEdit_property_caret_mid_grapheme>` | ``true`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`caret_move_on_right_click<class_TextEdit_property_caret_move_on_right_click>` | ``true`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`CaretType<enum_TextEdit_CaretType>` | :ref:`caret_type<class_TextEdit_property_caret_type>` | ``0`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_TextEdit_property_context_menu_enabled>` | ``true`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`deselect_on_focus_loss_enabled<class_TextEdit_property_deselect_on_focus_loss_enabled>` | ``true`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`draw_control_chars<class_TextEdit_property_draw_control_chars>` | ``false`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`draw_spaces<class_TextEdit_property_draw_spaces>` | ``false`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`draw_tabs<class_TextEdit_property_draw_tabs>` | ``false`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`editable<class_TextEdit_property_editable>` | ``true`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`highlight_all_occurrences<class_TextEdit_property_highlight_all_occurrences>` | ``false`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`highlight_current_line<class_TextEdit_property_highlight_current_line>` | ``false`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`language<class_TextEdit_property_language>` | ``""`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`middle_mouse_paste_enabled<class_TextEdit_property_middle_mouse_paste_enabled>` | ``true`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`minimap_draw<class_TextEdit_property_minimap_draw>` | ``false`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`minimap_width<class_TextEdit_property_minimap_width>` | ``80`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`CursorShape<enum_Control_CursorShape>` | mouse_default_cursor_shape | ``1`` (overrides :ref:`Control<class_Control_property_mouse_default_cursor_shape>`) |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`override_selected_font_color<class_TextEdit_property_override_selected_font_color>` | ``false`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`placeholder_text<class_TextEdit_property_placeholder_text>` | ``""`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`scroll_horizontal<class_TextEdit_property_scroll_horizontal>` | ``0`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`scroll_past_end_of_file<class_TextEdit_property_scroll_past_end_of_file>` | ``false`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`scroll_smooth<class_TextEdit_property_scroll_smooth>` | ``false`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`scroll_v_scroll_speed<class_TextEdit_property_scroll_v_scroll_speed>` | ``80.0`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`scroll_vertical<class_TextEdit_property_scroll_vertical>` | ``0.0`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` | ``true`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`shortcut_keys_enabled<class_TextEdit_property_shortcut_keys_enabled>` | ``true`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_TextEdit_property_structured_text_bidi_override>` | ``0`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_TextEdit_property_structured_text_bidi_override_options>` | ``[]`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` | :ref:`syntax_highlighter<class_TextEdit_property_syntax_highlighter>` | |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`text<class_TextEdit_property_text>` | ``""`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`text_direction<class_TextEdit_property_text_direction>` | ``0`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`virtual_keyboard_enabled<class_TextEdit_property_virtual_keyboard_enabled>` | ``true`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
| :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` | :ref:`wrap_mode<class_TextEdit_property_wrap_mode>` | ``0`` |
|
|
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`_backspace<class_TextEdit_method__backspace>` **(** **)** |virtual| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`_copy<class_TextEdit_method__copy>` **(** **)** |virtual| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`_cut<class_TextEdit_method__cut>` **(** **)** |virtual| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`_handle_unicode_input<class_TextEdit_method__handle_unicode_input>` **(** :ref:`int<class_int>` unicode_char **)** |virtual| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`_paste<class_TextEdit_method__paste>` **(** **)** |virtual| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`_paste_primary_clipboard<class_TextEdit_method__paste_primary_clipboard>` **(** **)** |virtual| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`add_gutter<class_TextEdit_method_add_gutter>` **(** :ref:`int<class_int>` at=-1 **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`adjust_viewport_to_caret<class_TextEdit_method_adjust_viewport_to_caret>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`backspace<class_TextEdit_method_backspace>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`begin_complex_operation<class_TextEdit_method_begin_complex_operation>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`center_viewport_to_caret<class_TextEdit_method_center_viewport_to_caret>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear<class_TextEdit_method_clear>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_opentype_features<class_TextEdit_method_clear_opentype_features>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_undo_history<class_TextEdit_method_clear_undo_history>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`copy<class_TextEdit_method_copy>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`cut<class_TextEdit_method_cut>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`delete_selection<class_TextEdit_method_delete_selection>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`deselect<class_TextEdit_method_deselect>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`end_complex_operation<class_TextEdit_method_end_complex_operation>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_caret_column<class_TextEdit_method_get_caret_column>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`get_caret_draw_pos<class_TextEdit_method_get_caret_draw_pos>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_caret_line<class_TextEdit_method_get_caret_line>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_caret_wrap_index<class_TextEdit_method_get_caret_wrap_index>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_first_non_whitespace_column<class_TextEdit_method_get_first_non_whitespace_column>` **(** :ref:`int<class_int>` line **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_first_visible_line<class_TextEdit_method_get_first_visible_line>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_gutter_count<class_TextEdit_method_get_gutter_count>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`get_gutter_name<class_TextEdit_method_get_gutter_name>` **(** :ref:`int<class_int>` gutter **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`GutterType<enum_TextEdit_GutterType>` | :ref:`get_gutter_type<class_TextEdit_method_get_gutter_type>` **(** :ref:`int<class_int>` gutter **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_gutter_width<class_TextEdit_method_get_gutter_width>` **(** :ref:`int<class_int>` gutter **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_indent_level<class_TextEdit_method_get_indent_level>` **(** :ref:`int<class_int>` line **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_last_full_visible_line<class_TextEdit_method_get_last_full_visible_line>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_last_full_visible_line_wrap_index<class_TextEdit_method_get_last_full_visible_line_wrap_index>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_last_unhidden_line<class_TextEdit_method_get_last_unhidden_line>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`get_line<class_TextEdit_method_get_line>` **(** :ref:`int<class_int>` line **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`get_line_background_color<class_TextEdit_method_get_line_background_color>` **(** :ref:`int<class_int>` line **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2i<class_Vector2i>` | :ref:`get_line_column_at_pos<class_TextEdit_method_get_line_column_at_pos>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`bool<class_bool>` allow_out_of_bounds=true **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_line_count<class_TextEdit_method_get_line_count>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Texture2D<class_Texture2D>` | :ref:`get_line_gutter_icon<class_TextEdit_method_get_line_gutter_icon>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`get_line_gutter_item_color<class_TextEdit_method_get_line_gutter_item_color>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Variant<class_Variant>` | :ref:`get_line_gutter_metadata<class_TextEdit_method_get_line_gutter_metadata>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`get_line_gutter_text<class_TextEdit_method_get_line_gutter_text>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_line_height<class_TextEdit_method_get_line_height>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_line_width<class_TextEdit_method_get_line_width>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=-1 **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_line_wrap_count<class_TextEdit_method_get_line_wrap_count>` **(** :ref:`int<class_int>` line **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_line_wrap_index_at_column<class_TextEdit_method_get_line_wrap_index_at_column>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_line_wrapped_text<class_TextEdit_method_get_line_wrapped_text>` **(** :ref:`int<class_int>` line **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`get_local_mouse_pos<class_TextEdit_method_get_local_mouse_pos>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_TextEdit_method_get_menu>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_minimap_line_at_pos<class_TextEdit_method_get_minimap_line_at_pos>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_minimap_visible_lines<class_TextEdit_method_get_minimap_visible_lines>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2i<class_Vector2i>` | :ref:`get_next_visible_line_index_offset_from<class_TextEdit_method_get_next_visible_line_index_offset_from>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index, :ref:`int<class_int>` visible_amount **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_next_visible_line_offset_from<class_TextEdit_method_get_next_visible_line_offset_from>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` visible_amount **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_opentype_feature<class_TextEdit_method_get_opentype_feature>` **(** :ref:`String<class_String>` tag **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2i<class_Vector2i>` | :ref:`get_pos_at_line_column<class_TextEdit_method_get_pos_at_line_column>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Rect2i<class_Rect2i>` | :ref:`get_rect_at_line_column<class_TextEdit_method_get_rect_at_line_column>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_saved_version<class_TextEdit_method_get_saved_version>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_scroll_pos_for_line<class_TextEdit_method_get_scroll_pos_for_line>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`get_selected_text<class_TextEdit_method_get_selected_text>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_selection_column<class_TextEdit_method_get_selection_column>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_selection_from_column<class_TextEdit_method_get_selection_from_column>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_selection_from_line<class_TextEdit_method_get_selection_from_line>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_selection_line<class_TextEdit_method_get_selection_line>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`SelectionMode<enum_TextEdit_SelectionMode>` | :ref:`get_selection_mode<class_TextEdit_method_get_selection_mode>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_selection_to_column<class_TextEdit_method_get_selection_to_column>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_selection_to_line<class_TextEdit_method_get_selection_to_line>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_tab_size<class_TextEdit_method_get_tab_size>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_total_gutter_width<class_TextEdit_method_get_total_gutter_width>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_total_visible_line_count<class_TextEdit_method_get_total_visible_line_count>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_version<class_TextEdit_method_get_version>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_visible_line_count<class_TextEdit_method_get_visible_line_count>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_visible_line_count_in_range<class_TextEdit_method_get_visible_line_count_in_range>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`get_word_at_pos<class_TextEdit_method_get_word_at_pos>` **(** :ref:`Vector2<class_Vector2>` position **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`get_word_under_caret<class_TextEdit_method_get_word_under_caret>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_ime_text<class_TextEdit_method_has_ime_text>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_redo<class_TextEdit_method_has_redo>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_selection<class_TextEdit_method_has_selection>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_undo<class_TextEdit_method_has_undo>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`insert_line_at<class_TextEdit_method_insert_line_at>` **(** :ref:`int<class_int>` line, :ref:`String<class_String>` text **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`insert_text_at_caret<class_TextEdit_method_insert_text_at_caret>` **(** :ref:`String<class_String>` text **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_caret_visible<class_TextEdit_method_is_caret_visible>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_dragging_cursor<class_TextEdit_method_is_dragging_cursor>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_gutter_clickable<class_TextEdit_method_is_gutter_clickable>` **(** :ref:`int<class_int>` gutter **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_gutter_drawn<class_TextEdit_method_is_gutter_drawn>` **(** :ref:`int<class_int>` gutter **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_gutter_overwritable<class_TextEdit_method_is_gutter_overwritable>` **(** :ref:`int<class_int>` gutter **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_line_gutter_clickable<class_TextEdit_method_is_line_gutter_clickable>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_line_wrapped<class_TextEdit_method_is_line_wrapped>` **(** :ref:`int<class_int>` line **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_menu_visible<class_TextEdit_method_is_menu_visible>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_mouse_over_selection<class_TextEdit_method_is_mouse_over_selection>` **(** :ref:`bool<class_bool>` edges **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_overtype_mode_enabled<class_TextEdit_method_is_overtype_mode_enabled>` **(** **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`menu_option<class_TextEdit_method_menu_option>` **(** :ref:`int<class_int>` option **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`merge_gutters<class_TextEdit_method_merge_gutters>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`paste<class_TextEdit_method_paste>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`redo<class_TextEdit_method_redo>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`remove_gutter<class_TextEdit_method_remove_gutter>` **(** :ref:`int<class_int>` gutter **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`remove_text<class_TextEdit_method_remove_text>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_column **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2i<class_Vector2i>` | :ref:`search<class_TextEdit_method_search>` **(** :ref:`String<class_String>` text, :ref:`int<class_int>` flags, :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_colum **)** |const| |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`select<class_TextEdit_method_select>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_column **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`select_all<class_TextEdit_method_select_all>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`select_word_under_caret<class_TextEdit_method_select_word_under_caret>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_caret_column<class_TextEdit_method_set_caret_column>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_caret_line<class_TextEdit_method_set_caret_line>` **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` adjust_viewport=true, :ref:`bool<class_bool>` can_be_hidden=true, :ref:`int<class_int>` wrap_index=0 **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_gutter_clickable<class_TextEdit_method_set_gutter_clickable>` **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` clickable **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_gutter_custom_draw<class_TextEdit_method_set_gutter_custom_draw>` **(** :ref:`int<class_int>` column, :ref:`Callable<class_Callable>` draw_callback **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_gutter_draw<class_TextEdit_method_set_gutter_draw>` **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` draw **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_gutter_name<class_TextEdit_method_set_gutter_name>` **(** :ref:`int<class_int>` gutter, :ref:`String<class_String>` name **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_gutter_overwritable<class_TextEdit_method_set_gutter_overwritable>` **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` overwritable **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_gutter_type<class_TextEdit_method_set_gutter_type>` **(** :ref:`int<class_int>` gutter, :ref:`GutterType<enum_TextEdit_GutterType>` type **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_gutter_width<class_TextEdit_method_set_gutter_width>` **(** :ref:`int<class_int>` gutter, :ref:`int<class_int>` width **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_line<class_TextEdit_method_set_line>` **(** :ref:`int<class_int>` line, :ref:`String<class_String>` new_text **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_line_as_center_visible<class_TextEdit_method_set_line_as_center_visible>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_line_as_first_visible<class_TextEdit_method_set_line_as_first_visible>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_line_as_last_visible<class_TextEdit_method_set_line_as_last_visible>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_line_background_color<class_TextEdit_method_set_line_background_color>` **(** :ref:`int<class_int>` line, :ref:`Color<class_Color>` color **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_line_gutter_clickable<class_TextEdit_method_set_line_gutter_clickable>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` clickable **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_line_gutter_icon<class_TextEdit_method_set_line_gutter_icon>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Texture2D<class_Texture2D>` icon **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_line_gutter_item_color<class_TextEdit_method_set_line_gutter_item_color>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Color<class_Color>` color **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_line_gutter_metadata<class_TextEdit_method_set_line_gutter_metadata>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Variant<class_Variant>` metadata **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_line_gutter_text<class_TextEdit_method_set_line_gutter_text>` **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`String<class_String>` text **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_opentype_feature<class_TextEdit_method_set_opentype_feature>` **(** :ref:`String<class_String>` tag, :ref:`int<class_int>` value **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_overtype_mode_enabled<class_TextEdit_method_set_overtype_mode_enabled>` **(** :ref:`bool<class_bool>` enabled **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_search_flags<class_TextEdit_method_set_search_flags>` **(** :ref:`int<class_int>` flags **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_search_text<class_TextEdit_method_set_search_text>` **(** :ref:`String<class_String>` search_text **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_selection_mode<class_TextEdit_method_set_selection_mode>` **(** :ref:`SelectionMode<enum_TextEdit_SelectionMode>` mode, :ref:`int<class_int>` line=-1, :ref:`int<class_int>` column=-1 **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_tab_size<class_TextEdit_method_set_tab_size>` **(** :ref:`int<class_int>` size **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_tooltip_request_func<class_TextEdit_method_set_tooltip_request_func>` **(** :ref:`Callable<class_Callable>` callback **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`swap_lines<class_TextEdit_method_swap_lines>` **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`tag_saved_version<class_TextEdit_method_tag_saved_version>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`undo<class_TextEdit_method_undo>` **(** **)** |
|
|
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Theme Properties
|
|
----------------
|
|
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`background_color<class_TextEdit_theme_color_background_color>` | ``Color(0, 0, 0, 0)`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`caret_background_color<class_TextEdit_theme_color_caret_background_color>` | ``Color(0, 0, 0, 1)`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`caret_color<class_TextEdit_theme_color_caret_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`current_line_color<class_TextEdit_theme_color_current_line_color>` | ``Color(0.25, 0.25, 0.26, 0.8)`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`font_color<class_TextEdit_theme_color_font_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`font_outline_color<class_TextEdit_theme_color_font_outline_color>` | ``Color(1, 1, 1, 1)`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`font_placeholder_color<class_TextEdit_theme_color_font_placeholder_color>` | ``Color(0.875, 0.875, 0.875, 0.6)`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`font_readonly_color<class_TextEdit_theme_color_font_readonly_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`font_selected_color<class_TextEdit_theme_color_font_selected_color>` | ``Color(1, 1, 1, 1)`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`search_result_border_color<class_TextEdit_theme_color_search_result_border_color>` | ``Color(0.3, 0.3, 0.3, 0.4)`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`search_result_color<class_TextEdit_theme_color_search_result_color>` | ``Color(0.3, 0.3, 0.3, 1)`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`selection_color<class_TextEdit_theme_color_selection_color>` | ``Color(0.5, 0.5, 0.5, 1)`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Color<class_Color>` | :ref:`word_highlighted_color<class_TextEdit_theme_color_word_highlighted_color>` | ``Color(0.5, 0.5, 0.5, 0.25)`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`caret_width<class_TextEdit_theme_constant_caret_width>` | ``1`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`line_spacing<class_TextEdit_theme_constant_line_spacing>` | ``4`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`outline_size<class_TextEdit_theme_constant_outline_size>` | ``0`` |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Font<class_Font>` | :ref:`font<class_TextEdit_theme_font_font>` | |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`font_size<class_TextEdit_theme_font_size_font_size>` | |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Texture2D<class_Texture2D>` | :ref:`space<class_TextEdit_theme_icon_space>` | |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`Texture2D<class_Texture2D>` | :ref:`tab<class_TextEdit_theme_icon_tab>` | |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_TextEdit_theme_style_focus>` | |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_TextEdit_theme_style_normal>` | |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
| :ref:`StyleBox<class_StyleBox>` | :ref:`read_only<class_TextEdit_theme_style_read_only>` | |
|
|
+-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+
|
|
|
|
Signals
|
|
-------
|
|
|
|
.. _class_TextEdit_signal_caret_changed:
|
|
|
|
- **caret_changed** **(** **)**
|
|
|
|
Emitted when the caret changes position.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_signal_gutter_added:
|
|
|
|
- **gutter_added** **(** **)**
|
|
|
|
Emitted when a gutter is added.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_signal_gutter_clicked:
|
|
|
|
- **gutter_clicked** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)**
|
|
|
|
Emitted when a gutter is clicked.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_signal_gutter_removed:
|
|
|
|
- **gutter_removed** **(** **)**
|
|
|
|
Emitted when a gutter is removed.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_signal_lines_edited_from:
|
|
|
|
- **lines_edited_from** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)**
|
|
|
|
Emitted immediately when the text changes.
|
|
|
|
When text is added ``from_line`` will be less then ``to_line``. On a remove ``to_line`` will be less then ``from_line``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_signal_text_changed:
|
|
|
|
- **text_changed** **(** **)**
|
|
|
|
Emitted when the text changes.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_signal_text_set:
|
|
|
|
- **text_set** **(** **)**
|
|
|
|
Emitted when :ref:`clear<class_TextEdit_method_clear>` is called or :ref:`text<class_TextEdit_property_text>` is set.
|
|
|
|
Enumerations
|
|
------------
|
|
|
|
.. _enum_TextEdit_MenuItems:
|
|
|
|
.. _class_TextEdit_constant_MENU_CUT:
|
|
|
|
.. _class_TextEdit_constant_MENU_COPY:
|
|
|
|
.. _class_TextEdit_constant_MENU_PASTE:
|
|
|
|
.. _class_TextEdit_constant_MENU_CLEAR:
|
|
|
|
.. _class_TextEdit_constant_MENU_SELECT_ALL:
|
|
|
|
.. _class_TextEdit_constant_MENU_UNDO:
|
|
|
|
.. _class_TextEdit_constant_MENU_REDO:
|
|
|
|
.. _class_TextEdit_constant_MENU_DIR_INHERITED:
|
|
|
|
.. _class_TextEdit_constant_MENU_DIR_AUTO:
|
|
|
|
.. _class_TextEdit_constant_MENU_DIR_LTR:
|
|
|
|
.. _class_TextEdit_constant_MENU_DIR_RTL:
|
|
|
|
.. _class_TextEdit_constant_MENU_DISPLAY_UCC:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_LRM:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_RLM:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_LRE:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_RLE:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_LRO:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_RLO:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_PDF:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_ALM:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_LRI:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_RLI:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_FSI:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_PDI:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_ZWJ:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_ZWNJ:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_WJ:
|
|
|
|
.. _class_TextEdit_constant_MENU_INSERT_SHY:
|
|
|
|
.. _class_TextEdit_constant_MENU_MAX:
|
|
|
|
enum **MenuItems**:
|
|
|
|
- **MENU_CUT** = **0** --- Cuts (copies and clears) the selected text.
|
|
|
|
- **MENU_COPY** = **1** --- Copies the selected text.
|
|
|
|
- **MENU_PASTE** = **2** --- Pastes the clipboard text over the selected text (or at the cursor's position).
|
|
|
|
- **MENU_CLEAR** = **3** --- Erases the whole ``TextEdit`` text.
|
|
|
|
- **MENU_SELECT_ALL** = **4** --- Selects the whole ``TextEdit`` text.
|
|
|
|
- **MENU_UNDO** = **5** --- Undoes the previous action.
|
|
|
|
- **MENU_REDO** = **6** --- Redoes the previous action.
|
|
|
|
- **MENU_DIR_INHERITED** = **7** --- Sets text direction to inherited.
|
|
|
|
- **MENU_DIR_AUTO** = **8** --- Sets text direction to automatic.
|
|
|
|
- **MENU_DIR_LTR** = **9** --- Sets text direction to left-to-right.
|
|
|
|
- **MENU_DIR_RTL** = **10** --- Sets text direction to right-to-left.
|
|
|
|
- **MENU_DISPLAY_UCC** = **11** --- Toggles control character display.
|
|
|
|
- **MENU_INSERT_LRM** = **12** --- Inserts left-to-right mark (LRM) character.
|
|
|
|
- **MENU_INSERT_RLM** = **13** --- Inserts right-to-left mark (RLM) character.
|
|
|
|
- **MENU_INSERT_LRE** = **14** --- Inserts start of left-to-right embedding (LRE) character.
|
|
|
|
- **MENU_INSERT_RLE** = **15** --- Inserts start of right-to-left embedding (RLE) character.
|
|
|
|
- **MENU_INSERT_LRO** = **16** --- Inserts start of left-to-right override (LRO) character.
|
|
|
|
- **MENU_INSERT_RLO** = **17** --- Inserts start of right-to-left override (RLO) character.
|
|
|
|
- **MENU_INSERT_PDF** = **18** --- Inserts pop direction formatting (PDF) character.
|
|
|
|
- **MENU_INSERT_ALM** = **19** --- Inserts Arabic letter mark (ALM) character.
|
|
|
|
- **MENU_INSERT_LRI** = **20** --- Inserts left-to-right isolate (LRI) character.
|
|
|
|
- **MENU_INSERT_RLI** = **21** --- Inserts right-to-left isolate (RLI) character.
|
|
|
|
- **MENU_INSERT_FSI** = **22** --- Inserts first strong isolate (FSI) character.
|
|
|
|
- **MENU_INSERT_PDI** = **23** --- Inserts pop direction isolate (PDI) character.
|
|
|
|
- **MENU_INSERT_ZWJ** = **24** --- Inserts zero width joiner (ZWJ) character.
|
|
|
|
- **MENU_INSERT_ZWNJ** = **25** --- Inserts zero width non-joiner (ZWNJ) character.
|
|
|
|
- **MENU_INSERT_WJ** = **26** --- Inserts word joiner (WJ) character.
|
|
|
|
- **MENU_INSERT_SHY** = **27** --- Inserts soft hyphen (SHY) character.
|
|
|
|
- **MENU_MAX** = **28** --- Represents the size of the :ref:`MenuItems<enum_TextEdit_MenuItems>` enum.
|
|
|
|
----
|
|
|
|
.. _enum_TextEdit_SearchFlags:
|
|
|
|
.. _class_TextEdit_constant_SEARCH_MATCH_CASE:
|
|
|
|
.. _class_TextEdit_constant_SEARCH_WHOLE_WORDS:
|
|
|
|
.. _class_TextEdit_constant_SEARCH_BACKWARDS:
|
|
|
|
enum **SearchFlags**:
|
|
|
|
- **SEARCH_MATCH_CASE** = **1** --- Match case when searching.
|
|
|
|
- **SEARCH_WHOLE_WORDS** = **2** --- Match whole words when searching.
|
|
|
|
- **SEARCH_BACKWARDS** = **4** --- Search from end to beginning.
|
|
|
|
----
|
|
|
|
.. _enum_TextEdit_CaretType:
|
|
|
|
.. _class_TextEdit_constant_CARET_TYPE_LINE:
|
|
|
|
.. _class_TextEdit_constant_CARET_TYPE_BLOCK:
|
|
|
|
enum **CaretType**:
|
|
|
|
- **CARET_TYPE_LINE** = **0** --- Vertical line caret.
|
|
|
|
- **CARET_TYPE_BLOCK** = **1** --- Block caret.
|
|
|
|
----
|
|
|
|
.. _enum_TextEdit_SelectionMode:
|
|
|
|
.. _class_TextEdit_constant_SELECTION_MODE_NONE:
|
|
|
|
.. _class_TextEdit_constant_SELECTION_MODE_SHIFT:
|
|
|
|
.. _class_TextEdit_constant_SELECTION_MODE_POINTER:
|
|
|
|
.. _class_TextEdit_constant_SELECTION_MODE_WORD:
|
|
|
|
.. _class_TextEdit_constant_SELECTION_MODE_LINE:
|
|
|
|
enum **SelectionMode**:
|
|
|
|
- **SELECTION_MODE_NONE** = **0** --- Not selecting.
|
|
|
|
- **SELECTION_MODE_SHIFT** = **1** --- Select as if ``shift`` is pressed.
|
|
|
|
- **SELECTION_MODE_POINTER** = **2** --- Select single characters as if the user single clicked.
|
|
|
|
- **SELECTION_MODE_WORD** = **3** --- Select whole words as if the user double clicked.
|
|
|
|
- **SELECTION_MODE_LINE** = **4** --- Select whole lines as if the user tripped clicked.
|
|
|
|
----
|
|
|
|
.. _enum_TextEdit_LineWrappingMode:
|
|
|
|
.. _class_TextEdit_constant_LINE_WRAPPING_NONE:
|
|
|
|
.. _class_TextEdit_constant_LINE_WRAPPING_BOUNDARY:
|
|
|
|
enum **LineWrappingMode**:
|
|
|
|
- **LINE_WRAPPING_NONE** = **0** --- Line wrapping is disabled.
|
|
|
|
- **LINE_WRAPPING_BOUNDARY** = **1** --- Line wrapping occurs at the control boundary, beyond what would normally be visible.
|
|
|
|
----
|
|
|
|
.. _enum_TextEdit_GutterType:
|
|
|
|
.. _class_TextEdit_constant_GUTTER_TYPE_STRING:
|
|
|
|
.. _class_TextEdit_constant_GUTTER_TYPE_ICON:
|
|
|
|
.. _class_TextEdit_constant_GUTTER_TYPE_CUSTOM:
|
|
|
|
enum **GutterType**:
|
|
|
|
- **GUTTER_TYPE_STRING** = **0** --- Draw a string.
|
|
|
|
- **GUTTER_TYPE_ICON** = **1** --- Draw an icon.
|
|
|
|
- **GUTTER_TYPE_CUSTOM** = **2** --- Custom draw.
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_TextEdit_property_caret_blink:
|
|
|
|
- :ref:`bool<class_bool>` **caret_blink**
|
|
|
|
+-----------+--------------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+--------------------------------+
|
|
| *Setter* | set_caret_blink_enabled(value) |
|
|
+-----------+--------------------------------+
|
|
| *Getter* | is_caret_blink_enabled() |
|
|
+-----------+--------------------------------+
|
|
|
|
Sets if the caret should blink.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_caret_blink_speed:
|
|
|
|
- :ref:`float<class_float>` **caret_blink_speed**
|
|
|
|
+-----------+------------------------------+
|
|
| *Default* | ``0.65`` |
|
|
+-----------+------------------------------+
|
|
| *Setter* | set_caret_blink_speed(value) |
|
|
+-----------+------------------------------+
|
|
| *Getter* | get_caret_blink_speed() |
|
|
+-----------+------------------------------+
|
|
|
|
Duration (in seconds) of a caret's blinking cycle.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_caret_mid_grapheme:
|
|
|
|
- :ref:`bool<class_bool>` **caret_mid_grapheme**
|
|
|
|
+-----------+---------------------------------------+
|
|
| *Default* | ``true`` |
|
|
+-----------+---------------------------------------+
|
|
| *Setter* | set_caret_mid_grapheme_enabled(value) |
|
|
+-----------+---------------------------------------+
|
|
| *Getter* | is_caret_mid_grapheme_enabled() |
|
|
+-----------+---------------------------------------+
|
|
|
|
Allow moving caret, selecting and removing the individual composite character components.
|
|
|
|
\ **Note:** :kbd:`Backspace` is always removing individual composite character components.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_caret_move_on_right_click:
|
|
|
|
- :ref:`bool<class_bool>` **caret_move_on_right_click**
|
|
|
|
+-----------+----------------------------------------------+
|
|
| *Default* | ``true`` |
|
|
+-----------+----------------------------------------------+
|
|
| *Setter* | set_move_caret_on_right_click_enabled(value) |
|
|
+-----------+----------------------------------------------+
|
|
| *Getter* | is_move_caret_on_right_click_enabled() |
|
|
+-----------+----------------------------------------------+
|
|
|
|
If ``true``, a right-click moves the caret at the mouse position before displaying the context menu.
|
|
|
|
If ``false``, the context menu disregards mouse location.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_caret_type:
|
|
|
|
- :ref:`CaretType<enum_TextEdit_CaretType>` **caret_type**
|
|
|
|
+-----------+-----------------------+
|
|
| *Default* | ``0`` |
|
|
+-----------+-----------------------+
|
|
| *Setter* | set_caret_type(value) |
|
|
+-----------+-----------------------+
|
|
| *Getter* | get_caret_type() |
|
|
+-----------+-----------------------+
|
|
|
|
Set the type of caret to draw.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_context_menu_enabled:
|
|
|
|
- :ref:`bool<class_bool>` **context_menu_enabled**
|
|
|
|
+-----------+---------------------------------+
|
|
| *Default* | ``true`` |
|
|
+-----------+---------------------------------+
|
|
| *Setter* | set_context_menu_enabled(value) |
|
|
+-----------+---------------------------------+
|
|
| *Getter* | is_context_menu_enabled() |
|
|
+-----------+---------------------------------+
|
|
|
|
If ``true``, a right-click displays the context menu.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_deselect_on_focus_loss_enabled:
|
|
|
|
- :ref:`bool<class_bool>` **deselect_on_focus_loss_enabled**
|
|
|
|
+-----------+-------------------------------------------+
|
|
| *Default* | ``true`` |
|
|
+-----------+-------------------------------------------+
|
|
| *Setter* | set_deselect_on_focus_loss_enabled(value) |
|
|
+-----------+-------------------------------------------+
|
|
| *Getter* | is_deselect_on_focus_loss_enabled() |
|
|
+-----------+-------------------------------------------+
|
|
|
|
If ``true``, the selected text will be deselected when focus is lost.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_draw_control_chars:
|
|
|
|
- :ref:`bool<class_bool>` **draw_control_chars**
|
|
|
|
+-----------+-------------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-------------------------------+
|
|
| *Setter* | set_draw_control_chars(value) |
|
|
+-----------+-------------------------------+
|
|
| *Getter* | get_draw_control_chars() |
|
|
+-----------+-------------------------------+
|
|
|
|
If ``true``, control characters are displayed.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_draw_spaces:
|
|
|
|
- :ref:`bool<class_bool>` **draw_spaces**
|
|
|
|
+-----------+------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+------------------------+
|
|
| *Setter* | set_draw_spaces(value) |
|
|
+-----------+------------------------+
|
|
| *Getter* | is_drawing_spaces() |
|
|
+-----------+------------------------+
|
|
|
|
If ``true``, the "space" character will have a visible representation.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_draw_tabs:
|
|
|
|
- :ref:`bool<class_bool>` **draw_tabs**
|
|
|
|
+-----------+----------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+----------------------+
|
|
| *Setter* | set_draw_tabs(value) |
|
|
+-----------+----------------------+
|
|
| *Getter* | is_drawing_tabs() |
|
|
+-----------+----------------------+
|
|
|
|
If ``true``, the "tab" character will have a visible representation.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_editable:
|
|
|
|
- :ref:`bool<class_bool>` **editable**
|
|
|
|
+-----------+---------------------+
|
|
| *Default* | ``true`` |
|
|
+-----------+---------------------+
|
|
| *Setter* | set_editable(value) |
|
|
+-----------+---------------------+
|
|
| *Getter* | is_editable() |
|
|
+-----------+---------------------+
|
|
|
|
If ``false``, existing text cannot be modified and new text cannot be added.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_highlight_all_occurrences:
|
|
|
|
- :ref:`bool<class_bool>` **highlight_all_occurrences**
|
|
|
|
+-----------+----------------------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+----------------------------------------+
|
|
| *Setter* | set_highlight_all_occurrences(value) |
|
|
+-----------+----------------------------------------+
|
|
| *Getter* | is_highlight_all_occurrences_enabled() |
|
|
+-----------+----------------------------------------+
|
|
|
|
If ``true``, all occurrences of the selected text will be highlighted.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_highlight_current_line:
|
|
|
|
- :ref:`bool<class_bool>` **highlight_current_line**
|
|
|
|
+-----------+-------------------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-------------------------------------+
|
|
| *Setter* | set_highlight_current_line(value) |
|
|
+-----------+-------------------------------------+
|
|
| *Getter* | is_highlight_current_line_enabled() |
|
|
+-----------+-------------------------------------+
|
|
|
|
If ``true``, the line containing the cursor is highlighted.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_language:
|
|
|
|
- :ref:`String<class_String>` **language**
|
|
|
|
+-----------+---------------------+
|
|
| *Default* | ``""`` |
|
|
+-----------+---------------------+
|
|
| *Setter* | set_language(value) |
|
|
+-----------+---------------------+
|
|
| *Getter* | get_language() |
|
|
+-----------+---------------------+
|
|
|
|
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_middle_mouse_paste_enabled:
|
|
|
|
- :ref:`bool<class_bool>` **middle_mouse_paste_enabled**
|
|
|
|
+-----------+---------------------------------------+
|
|
| *Default* | ``true`` |
|
|
+-----------+---------------------------------------+
|
|
| *Setter* | set_middle_mouse_paste_enabled(value) |
|
|
+-----------+---------------------------------------+
|
|
| *Getter* | is_middle_mouse_paste_enabled() |
|
|
+-----------+---------------------------------------+
|
|
|
|
If ``false``, using middle mouse button to paste clipboard will be disabled.
|
|
|
|
\ **Note:** This method is only implemented on Linux.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_minimap_draw:
|
|
|
|
- :ref:`bool<class_bool>` **minimap_draw**
|
|
|
|
+-----------+-------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-------------------------+
|
|
| *Setter* | set_draw_minimap(value) |
|
|
+-----------+-------------------------+
|
|
| *Getter* | is_drawing_minimap() |
|
|
+-----------+-------------------------+
|
|
|
|
If ``true``, a minimap is shown, providing an outline of your source code.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_minimap_width:
|
|
|
|
- :ref:`int<class_int>` **minimap_width**
|
|
|
|
+-----------+--------------------------+
|
|
| *Default* | ``80`` |
|
|
+-----------+--------------------------+
|
|
| *Setter* | set_minimap_width(value) |
|
|
+-----------+--------------------------+
|
|
| *Getter* | get_minimap_width() |
|
|
+-----------+--------------------------+
|
|
|
|
The width, in pixels, of the minimap.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_override_selected_font_color:
|
|
|
|
- :ref:`bool<class_bool>` **override_selected_font_color**
|
|
|
|
+-----------+-----------------------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-----------------------------------------+
|
|
| *Setter* | set_override_selected_font_color(value) |
|
|
+-----------+-----------------------------------------+
|
|
| *Getter* | is_overriding_selected_font_color() |
|
|
+-----------+-----------------------------------------+
|
|
|
|
If ``true``, custom ``font_selected_color`` will be used for selected text.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_placeholder_text:
|
|
|
|
- :ref:`String<class_String>` **placeholder_text**
|
|
|
|
+-----------+------------------------+
|
|
| *Default* | ``""`` |
|
|
+-----------+------------------------+
|
|
| *Setter* | set_placeholder(value) |
|
|
+-----------+------------------------+
|
|
| *Getter* | get_placeholder() |
|
|
+-----------+------------------------+
|
|
|
|
Text shown when the ``TextEdit`` is empty. It is **not** the ``TextEdit``'s default value (see :ref:`text<class_TextEdit_property_text>`).
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_scroll_horizontal:
|
|
|
|
- :ref:`int<class_int>` **scroll_horizontal**
|
|
|
|
+-----------+---------------------+
|
|
| *Default* | ``0`` |
|
|
+-----------+---------------------+
|
|
| *Setter* | set_h_scroll(value) |
|
|
+-----------+---------------------+
|
|
| *Getter* | get_h_scroll() |
|
|
+-----------+---------------------+
|
|
|
|
If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_scroll_past_end_of_file:
|
|
|
|
- :ref:`bool<class_bool>` **scroll_past_end_of_file**
|
|
|
|
+-----------+--------------------------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+--------------------------------------------+
|
|
| *Setter* | set_scroll_past_end_of_file_enabled(value) |
|
|
+-----------+--------------------------------------------+
|
|
| *Getter* | is_scroll_past_end_of_file_enabled() |
|
|
+-----------+--------------------------------------------+
|
|
|
|
Allow scrolling past the last line into "virtual" space.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_scroll_smooth:
|
|
|
|
- :ref:`bool<class_bool>` **scroll_smooth**
|
|
|
|
+-----------+---------------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+---------------------------------+
|
|
| *Setter* | set_smooth_scroll_enable(value) |
|
|
+-----------+---------------------------------+
|
|
| *Getter* | is_smooth_scroll_enabled() |
|
|
+-----------+---------------------------------+
|
|
|
|
Scroll smoothly over the text rather then jumping to the next location.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_scroll_v_scroll_speed:
|
|
|
|
- :ref:`float<class_float>` **scroll_v_scroll_speed**
|
|
|
|
+-----------+---------------------------+
|
|
| *Default* | ``80.0`` |
|
|
+-----------+---------------------------+
|
|
| *Setter* | set_v_scroll_speed(value) |
|
|
+-----------+---------------------------+
|
|
| *Getter* | get_v_scroll_speed() |
|
|
+-----------+---------------------------+
|
|
|
|
Sets the scroll speed with the minimap or when :ref:`scroll_smooth<class_TextEdit_property_scroll_smooth>` is enabled.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_scroll_vertical:
|
|
|
|
- :ref:`float<class_float>` **scroll_vertical**
|
|
|
|
+-----------+---------------------+
|
|
| *Default* | ``0.0`` |
|
|
+-----------+---------------------+
|
|
| *Setter* | set_v_scroll(value) |
|
|
+-----------+---------------------+
|
|
| *Getter* | get_v_scroll() |
|
|
+-----------+---------------------+
|
|
|
|
If there is a vertical scrollbar, this determines the current vertical scroll value in line numbers, starting at 0 for the top line.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_selecting_enabled:
|
|
|
|
- :ref:`bool<class_bool>` **selecting_enabled**
|
|
|
|
+-----------+------------------------------+
|
|
| *Default* | ``true`` |
|
|
+-----------+------------------------------+
|
|
| *Setter* | set_selecting_enabled(value) |
|
|
+-----------+------------------------------+
|
|
| *Getter* | is_selecting_enabled() |
|
|
+-----------+------------------------------+
|
|
|
|
If ``true``, text can be selected.
|
|
|
|
If ``false``, text can not be selected by the user or by the :ref:`select<class_TextEdit_method_select>` or :ref:`select_all<class_TextEdit_method_select_all>` methods.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_shortcut_keys_enabled:
|
|
|
|
- :ref:`bool<class_bool>` **shortcut_keys_enabled**
|
|
|
|
+-----------+----------------------------------+
|
|
| *Default* | ``true`` |
|
|
+-----------+----------------------------------+
|
|
| *Setter* | set_shortcut_keys_enabled(value) |
|
|
+-----------+----------------------------------+
|
|
| *Getter* | is_shortcut_keys_enabled() |
|
|
+-----------+----------------------------------+
|
|
|
|
If ``true``, shortcut keys for context menu items are enabled, even if the context menu is disabled.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_structured_text_bidi_override:
|
|
|
|
- :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` **structured_text_bidi_override**
|
|
|
|
+-----------+------------------------------------------+
|
|
| *Default* | ``0`` |
|
|
+-----------+------------------------------------------+
|
|
| *Setter* | set_structured_text_bidi_override(value) |
|
|
+-----------+------------------------------------------+
|
|
| *Getter* | get_structured_text_bidi_override() |
|
|
+-----------+------------------------------------------+
|
|
|
|
Set BiDi algorithm override for the structured text.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_structured_text_bidi_override_options:
|
|
|
|
- :ref:`Array<class_Array>` **structured_text_bidi_override_options**
|
|
|
|
+-----------+--------------------------------------------------+
|
|
| *Default* | ``[]`` |
|
|
+-----------+--------------------------------------------------+
|
|
| *Setter* | set_structured_text_bidi_override_options(value) |
|
|
+-----------+--------------------------------------------------+
|
|
| *Getter* | get_structured_text_bidi_override_options() |
|
|
+-----------+--------------------------------------------------+
|
|
|
|
Set additional options for BiDi override.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_syntax_highlighter:
|
|
|
|
- :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` **syntax_highlighter**
|
|
|
|
+----------+-------------------------------+
|
|
| *Setter* | set_syntax_highlighter(value) |
|
|
+----------+-------------------------------+
|
|
| *Getter* | get_syntax_highlighter() |
|
|
+----------+-------------------------------+
|
|
|
|
Sets the :ref:`SyntaxHighlighter<class_SyntaxHighlighter>` to use.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_text:
|
|
|
|
- :ref:`String<class_String>` **text**
|
|
|
|
+-----------+-----------------+
|
|
| *Default* | ``""`` |
|
|
+-----------+-----------------+
|
|
| *Setter* | set_text(value) |
|
|
+-----------+-----------------+
|
|
| *Getter* | get_text() |
|
|
+-----------+-----------------+
|
|
|
|
String value of the ``TextEdit``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_text_direction:
|
|
|
|
- :ref:`TextDirection<enum_Control_TextDirection>` **text_direction**
|
|
|
|
+-----------+---------------------------+
|
|
| *Default* | ``0`` |
|
|
+-----------+---------------------------+
|
|
| *Setter* | set_text_direction(value) |
|
|
+-----------+---------------------------+
|
|
| *Getter* | get_text_direction() |
|
|
+-----------+---------------------------+
|
|
|
|
Base text writing direction.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_virtual_keyboard_enabled:
|
|
|
|
- :ref:`bool<class_bool>` **virtual_keyboard_enabled**
|
|
|
|
+-----------+-------------------------------------+
|
|
| *Default* | ``true`` |
|
|
+-----------+-------------------------------------+
|
|
| *Setter* | set_virtual_keyboard_enabled(value) |
|
|
+-----------+-------------------------------------+
|
|
| *Getter* | is_virtual_keyboard_enabled() |
|
|
+-----------+-------------------------------------+
|
|
|
|
If ``true``, the native virtual keyboard is shown when focused on platforms that support it.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_property_wrap_mode:
|
|
|
|
- :ref:`LineWrappingMode<enum_TextEdit_LineWrappingMode>` **wrap_mode**
|
|
|
|
+-----------+-------------------------------+
|
|
| *Default* | ``0`` |
|
|
+-----------+-------------------------------+
|
|
| *Setter* | set_line_wrapping_mode(value) |
|
|
+-----------+-------------------------------+
|
|
| *Getter* | get_line_wrapping_mode() |
|
|
+-----------+-------------------------------+
|
|
|
|
Sets the line wrapping mode to use.
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_TextEdit_method__backspace:
|
|
|
|
- void **_backspace** **(** **)** |virtual|
|
|
|
|
Override this method to define what happens when the user presses the backspace key.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method__copy:
|
|
|
|
- void **_copy** **(** **)** |virtual|
|
|
|
|
Override this method to define what happens when the user performs a copy operation.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method__cut:
|
|
|
|
- void **_cut** **(** **)** |virtual|
|
|
|
|
Override this method to define what happens when the user performs a cut operation.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method__handle_unicode_input:
|
|
|
|
- void **_handle_unicode_input** **(** :ref:`int<class_int>` unicode_char **)** |virtual|
|
|
|
|
Override this method to define what happens when the types in the provided key ``unicode``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method__paste:
|
|
|
|
- void **_paste** **(** **)** |virtual|
|
|
|
|
Override this method to define what happens when the user performs a paste operation.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method__paste_primary_clipboard:
|
|
|
|
- void **_paste_primary_clipboard** **(** **)** |virtual|
|
|
|
|
Override this method to define what happens when the user performs a paste operation with middle mouse button.
|
|
|
|
\ **Note:** This method is only implemented on Linux.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_add_gutter:
|
|
|
|
- void **add_gutter** **(** :ref:`int<class_int>` at=-1 **)**
|
|
|
|
Register a new gutter to this ``TextEdit``. Use ``at`` to have a specific gutter order. A value of ``-1`` appends the gutter to the right.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_adjust_viewport_to_caret:
|
|
|
|
- void **adjust_viewport_to_caret** **(** **)**
|
|
|
|
Adjust the viewport so the caret is visible.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_backspace:
|
|
|
|
- void **backspace** **(** **)**
|
|
|
|
Called when the user presses the backspace key. Can be overridden with :ref:`_backspace<class_TextEdit_method__backspace>`.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_begin_complex_operation:
|
|
|
|
- void **begin_complex_operation** **(** **)**
|
|
|
|
Starts a multipart edit. All edits will be treated as one action until :ref:`end_complex_operation<class_TextEdit_method_end_complex_operation>` is called.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_center_viewport_to_caret:
|
|
|
|
- void **center_viewport_to_caret** **(** **)**
|
|
|
|
Centers the viewport on the line the editing caret is at. This also resets the :ref:`scroll_horizontal<class_TextEdit_property_scroll_horizontal>` value to ``0``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_clear:
|
|
|
|
- void **clear** **(** **)**
|
|
|
|
Performs a full reset of ``TextEdit``, including undo history.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_clear_opentype_features:
|
|
|
|
- void **clear_opentype_features** **(** **)**
|
|
|
|
Removes all OpenType features.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_clear_undo_history:
|
|
|
|
- void **clear_undo_history** **(** **)**
|
|
|
|
Clears the undo history.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_copy:
|
|
|
|
- void **copy** **(** **)**
|
|
|
|
Copies the current text selection. Can be overridden with :ref:`_copy<class_TextEdit_method__copy>`.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_cut:
|
|
|
|
- void **cut** **(** **)**
|
|
|
|
Cut's the current selection. Can be overridden with :ref:`_cut<class_TextEdit_method__cut>`.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_delete_selection:
|
|
|
|
- void **delete_selection** **(** **)**
|
|
|
|
Deletes the selected text.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_deselect:
|
|
|
|
- void **deselect** **(** **)**
|
|
|
|
Deselects the current selection.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_end_complex_operation:
|
|
|
|
- void **end_complex_operation** **(** **)**
|
|
|
|
Ends a multipart edit, started with :ref:`begin_complex_operation<class_TextEdit_method_begin_complex_operation>`. If called outside a complex operation, the current operation is pushed onto the undo/redo stack.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_caret_column:
|
|
|
|
- :ref:`int<class_int>` **get_caret_column** **(** **)** |const|
|
|
|
|
Returns the column the editing caret is at.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_caret_draw_pos:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **get_caret_draw_pos** **(** **)** |const|
|
|
|
|
Returns the caret pixel draw position.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_caret_line:
|
|
|
|
- :ref:`int<class_int>` **get_caret_line** **(** **)** |const|
|
|
|
|
Returns the line the editing caret is on.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_caret_wrap_index:
|
|
|
|
- :ref:`int<class_int>` **get_caret_wrap_index** **(** **)** |const|
|
|
|
|
Returns the wrap index the editing caret is on.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_first_non_whitespace_column:
|
|
|
|
- :ref:`int<class_int>` **get_first_non_whitespace_column** **(** :ref:`int<class_int>` line **)** |const|
|
|
|
|
Returns the first column containing a non-whitespace character.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_first_visible_line:
|
|
|
|
- :ref:`int<class_int>` **get_first_visible_line** **(** **)** |const|
|
|
|
|
Returns the first visible line.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_gutter_count:
|
|
|
|
- :ref:`int<class_int>` **get_gutter_count** **(** **)** |const|
|
|
|
|
Returns the total amount of gutters registered.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_gutter_name:
|
|
|
|
- :ref:`String<class_String>` **get_gutter_name** **(** :ref:`int<class_int>` gutter **)** |const|
|
|
|
|
Returns the name of the gutter at the given index.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_gutter_type:
|
|
|
|
- :ref:`GutterType<enum_TextEdit_GutterType>` **get_gutter_type** **(** :ref:`int<class_int>` gutter **)** |const|
|
|
|
|
Returns the type of the gutter at the given index.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_gutter_width:
|
|
|
|
- :ref:`int<class_int>` **get_gutter_width** **(** :ref:`int<class_int>` gutter **)** |const|
|
|
|
|
Returns the width of the gutter at the given index.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_indent_level:
|
|
|
|
- :ref:`int<class_int>` **get_indent_level** **(** :ref:`int<class_int>` line **)** |const|
|
|
|
|
Returns the amount of spaces and ``tab * tab_size`` before the first char.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_last_full_visible_line:
|
|
|
|
- :ref:`int<class_int>` **get_last_full_visible_line** **(** **)** |const|
|
|
|
|
Returns the last visible line. Use :ref:`get_last_full_visible_line_wrap_index<class_TextEdit_method_get_last_full_visible_line_wrap_index>` for the wrap index.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_last_full_visible_line_wrap_index:
|
|
|
|
- :ref:`int<class_int>` **get_last_full_visible_line_wrap_index** **(** **)** |const|
|
|
|
|
Returns the last visible wrap index of the last visible line.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_last_unhidden_line:
|
|
|
|
- :ref:`int<class_int>` **get_last_unhidden_line** **(** **)** |const|
|
|
|
|
Returns the last unhidden line in the entire ``TextEdit``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_line:
|
|
|
|
- :ref:`String<class_String>` **get_line** **(** :ref:`int<class_int>` line **)** |const|
|
|
|
|
Returns the text of a specific line.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_line_background_color:
|
|
|
|
- :ref:`Color<class_Color>` **get_line_background_color** **(** :ref:`int<class_int>` line **)** |const|
|
|
|
|
Returns the current background color of the line. ``Color(0, 0, 0, 0)`` is returned if no color is set.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_line_column_at_pos:
|
|
|
|
- :ref:`Vector2i<class_Vector2i>` **get_line_column_at_pos** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`bool<class_bool>` allow_out_of_bounds=true **)** |const|
|
|
|
|
Returns the line and column at the given position. In the returned vector, ``x`` is the column, ``y`` is the line. If ``allow_out_of_bounds`` is ``false`` and the position is not over the text, both vector values will be set to ``-1``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_line_count:
|
|
|
|
- :ref:`int<class_int>` **get_line_count** **(** **)** |const|
|
|
|
|
Returns the amount of total lines in the text.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_line_gutter_icon:
|
|
|
|
- :ref:`Texture2D<class_Texture2D>` **get_line_gutter_icon** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
|
|
|
|
Returns the icon currently in ``gutter`` at ``line``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_line_gutter_item_color:
|
|
|
|
- :ref:`Color<class_Color>` **get_line_gutter_item_color** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
|
|
|
|
Returns the color currently in ``gutter`` at ``line``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_line_gutter_metadata:
|
|
|
|
- :ref:`Variant<class_Variant>` **get_line_gutter_metadata** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
|
|
|
|
Returns the metadata currently in ``gutter`` at ``line``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_line_gutter_text:
|
|
|
|
- :ref:`String<class_String>` **get_line_gutter_text** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
|
|
|
|
Returns the text currently in ``gutter`` at ``line``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_line_height:
|
|
|
|
- :ref:`int<class_int>` **get_line_height** **(** **)** |const|
|
|
|
|
Returns the height of a largest line.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_line_width:
|
|
|
|
- :ref:`int<class_int>` **get_line_width** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=-1 **)** |const|
|
|
|
|
Returns the width in pixels of the ``wrap_index`` on ``line``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_line_wrap_count:
|
|
|
|
- :ref:`int<class_int>` **get_line_wrap_count** **(** :ref:`int<class_int>` line **)** |const|
|
|
|
|
Returns the number of times the given line is wrapped.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_line_wrap_index_at_column:
|
|
|
|
- :ref:`int<class_int>` **get_line_wrap_index_at_column** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the wrap index of the given line column.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_line_wrapped_text:
|
|
|
|
- :ref:`PackedStringArray<class_PackedStringArray>` **get_line_wrapped_text** **(** :ref:`int<class_int>` line **)** |const|
|
|
|
|
Returns an array of :ref:`String<class_String>`\ s representing each wrapped index.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_local_mouse_pos:
|
|
|
|
- :ref:`Vector2<class_Vector2>` **get_local_mouse_pos** **(** **)** |const|
|
|
|
|
Returns the local mouse position adjusted for the text direction.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_menu:
|
|
|
|
- :ref:`PopupMenu<class_PopupMenu>` **get_menu** **(** **)** |const|
|
|
|
|
Returns the :ref:`PopupMenu<class_PopupMenu>` of this ``TextEdit``. By default, this menu is displayed when right-clicking on the ``TextEdit``.
|
|
|
|
\ **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.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_minimap_line_at_pos:
|
|
|
|
- :ref:`int<class_int>` **get_minimap_line_at_pos** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
|
|
|
|
Returns the equivalent minimap line at ``position``
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_minimap_visible_lines:
|
|
|
|
- :ref:`int<class_int>` **get_minimap_visible_lines** **(** **)** |const|
|
|
|
|
Returns the total amount of lines that can be draw on the minimap.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_next_visible_line_index_offset_from:
|
|
|
|
- :ref:`Vector2i<class_Vector2i>` **get_next_visible_line_index_offset_from** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index, :ref:`int<class_int>` visible_amount **)** |const|
|
|
|
|
Similar to :ref:`get_next_visible_line_offset_from<class_TextEdit_method_get_next_visible_line_offset_from>`, but takes into account the line wrap indexes. In the returned vector, ``x`` is the line, ``y`` is the wrap index.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_next_visible_line_offset_from:
|
|
|
|
- :ref:`int<class_int>` **get_next_visible_line_offset_from** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` visible_amount **)** |const|
|
|
|
|
Returns the count to the next visible line from ``line`` to ``line + visible_amount``. Can also count backwards. For example if a ``TextEdit`` has 5 lines with lines 2 and 3 hidden, calling this with ``line = 1, visible_amount = 1`` would return 3.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_opentype_feature:
|
|
|
|
- :ref:`int<class_int>` **get_opentype_feature** **(** :ref:`String<class_String>` tag **)** |const|
|
|
|
|
Returns OpenType feature ``tag``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_pos_at_line_column:
|
|
|
|
- :ref:`Vector2i<class_Vector2i>` **get_pos_at_line_column** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the local position for the given ``line`` and ``column``. If ``x`` or ``y`` of the returned vector equal ``-1``, the position is outside of the viewable area of the control.
|
|
|
|
\ **Note:** The Y position corresponds to the bottom side of the line. Use :ref:`get_rect_at_line_column<class_TextEdit_method_get_rect_at_line_column>` to get the top side position.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_rect_at_line_column:
|
|
|
|
- :ref:`Rect2i<class_Rect2i>` **get_rect_at_line_column** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` column **)** |const|
|
|
|
|
Returns the local position and size for the grapheme at the given ``line`` and ``column``. If ``x`` or ``y`` position of the returned rect equal ``-1``, the position is outside of the viewable area of the control.
|
|
|
|
\ **Note:** The Y position of the returned rect corresponds to the top side of the line, unlike :ref:`get_pos_at_line_column<class_TextEdit_method_get_pos_at_line_column>` which returns the bottom side.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_saved_version:
|
|
|
|
- :ref:`int<class_int>` **get_saved_version** **(** **)** |const|
|
|
|
|
Returns the last tagged saved version from :ref:`tag_saved_version<class_TextEdit_method_tag_saved_version>`
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_scroll_pos_for_line:
|
|
|
|
- :ref:`float<class_float>` **get_scroll_pos_for_line** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)** |const|
|
|
|
|
Returns the scroll position for ``wrap_index`` of ``line``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_selected_text:
|
|
|
|
- :ref:`String<class_String>` **get_selected_text** **(** **)** |const|
|
|
|
|
Returns the text inside the selection.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_selection_column:
|
|
|
|
- :ref:`int<class_int>` **get_selection_column** **(** **)** |const|
|
|
|
|
Returns the original start column of the selection.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_selection_from_column:
|
|
|
|
- :ref:`int<class_int>` **get_selection_from_column** **(** **)** |const|
|
|
|
|
Returns the selection begin column.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_selection_from_line:
|
|
|
|
- :ref:`int<class_int>` **get_selection_from_line** **(** **)** |const|
|
|
|
|
Returns the selection begin line.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_selection_line:
|
|
|
|
- :ref:`int<class_int>` **get_selection_line** **(** **)** |const|
|
|
|
|
Returns the original start line of the selection.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_selection_mode:
|
|
|
|
- :ref:`SelectionMode<enum_TextEdit_SelectionMode>` **get_selection_mode** **(** **)** |const|
|
|
|
|
Returns the current selection mode.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_selection_to_column:
|
|
|
|
- :ref:`int<class_int>` **get_selection_to_column** **(** **)** |const|
|
|
|
|
Returns the selection end column.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_selection_to_line:
|
|
|
|
- :ref:`int<class_int>` **get_selection_to_line** **(** **)** |const|
|
|
|
|
Returns the selection end line.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_tab_size:
|
|
|
|
- :ref:`int<class_int>` **get_tab_size** **(** **)** |const|
|
|
|
|
Returns the ``TextEdit``'s' tab size.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_total_gutter_width:
|
|
|
|
- :ref:`int<class_int>` **get_total_gutter_width** **(** **)** |const|
|
|
|
|
Returns the total width of all gutters and internal padding.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_total_visible_line_count:
|
|
|
|
- :ref:`int<class_int>` **get_total_visible_line_count** **(** **)** |const|
|
|
|
|
Returns the total amount of lines that could be draw.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_version:
|
|
|
|
- :ref:`int<class_int>` **get_version** **(** **)** |const|
|
|
|
|
Returns the current version of the ``TextEdit``. The version is a count of recorded operations by the undo/redo history.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_visible_line_count:
|
|
|
|
- :ref:`int<class_int>` **get_visible_line_count** **(** **)** |const|
|
|
|
|
Returns the number of visible lines, including wrapped text.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_visible_line_count_in_range:
|
|
|
|
- :ref:`int<class_int>` **get_visible_line_count_in_range** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)** |const|
|
|
|
|
Returns the total number of visible + wrapped lines between the two lines.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_word_at_pos:
|
|
|
|
- :ref:`String<class_String>` **get_word_at_pos** **(** :ref:`Vector2<class_Vector2>` position **)** |const|
|
|
|
|
Returns the word at ``position``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_get_word_under_caret:
|
|
|
|
- :ref:`String<class_String>` **get_word_under_caret** **(** **)** |const|
|
|
|
|
Returns a :ref:`String<class_String>` text with the word under the caret's location.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_has_ime_text:
|
|
|
|
- :ref:`bool<class_bool>` **has_ime_text** **(** **)** |const|
|
|
|
|
Returns if the user has IME text.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_has_redo:
|
|
|
|
- :ref:`bool<class_bool>` **has_redo** **(** **)** |const|
|
|
|
|
Returns ``true`` if a "redo" action is available.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_has_selection:
|
|
|
|
- :ref:`bool<class_bool>` **has_selection** **(** **)** |const|
|
|
|
|
Returns ``true`` if the user has selected text.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_has_undo:
|
|
|
|
- :ref:`bool<class_bool>` **has_undo** **(** **)** |const|
|
|
|
|
Returns ``true`` if an "undo" action is available.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_insert_line_at:
|
|
|
|
- void **insert_line_at** **(** :ref:`int<class_int>` line, :ref:`String<class_String>` text **)**
|
|
|
|
Inserts a new line with ``text`` at ``line``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_insert_text_at_caret:
|
|
|
|
- void **insert_text_at_caret** **(** :ref:`String<class_String>` text **)**
|
|
|
|
Insert the specified text at the caret position.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_is_caret_visible:
|
|
|
|
- :ref:`bool<class_bool>` **is_caret_visible** **(** **)** |const|
|
|
|
|
Returns ``true`` if the caret is visible on the screen.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_is_dragging_cursor:
|
|
|
|
- :ref:`bool<class_bool>` **is_dragging_cursor** **(** **)** |const|
|
|
|
|
Returns ``true`` if the user is dragging their mouse for scrolling or selecting.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_is_gutter_clickable:
|
|
|
|
- :ref:`bool<class_bool>` **is_gutter_clickable** **(** :ref:`int<class_int>` gutter **)** |const|
|
|
|
|
Returns whether the gutter is clickable.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_is_gutter_drawn:
|
|
|
|
- :ref:`bool<class_bool>` **is_gutter_drawn** **(** :ref:`int<class_int>` gutter **)** |const|
|
|
|
|
Returns whether the gutter is currently drawn.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_is_gutter_overwritable:
|
|
|
|
- :ref:`bool<class_bool>` **is_gutter_overwritable** **(** :ref:`int<class_int>` gutter **)** |const|
|
|
|
|
Returns whether the gutter is overwritable.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_is_line_gutter_clickable:
|
|
|
|
- :ref:`bool<class_bool>` **is_line_gutter_clickable** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter **)** |const|
|
|
|
|
Returns whether the gutter on the given line is clickable.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_is_line_wrapped:
|
|
|
|
- :ref:`bool<class_bool>` **is_line_wrapped** **(** :ref:`int<class_int>` line **)** |const|
|
|
|
|
Returns if the given line is wrapped.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_is_menu_visible:
|
|
|
|
- :ref:`bool<class_bool>` **is_menu_visible** **(** **)** |const|
|
|
|
|
Returns whether the menu is visible. Use this instead of ``get_menu().visible`` to improve performance (so the creation of the menu is avoided).
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_is_mouse_over_selection:
|
|
|
|
- :ref:`bool<class_bool>` **is_mouse_over_selection** **(** :ref:`bool<class_bool>` edges **)** |const|
|
|
|
|
Returns whether the mouse is over selection. If ``edges`` is ``true``, the edges are considered part of the selection.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_is_overtype_mode_enabled:
|
|
|
|
- :ref:`bool<class_bool>` **is_overtype_mode_enabled** **(** **)** |const|
|
|
|
|
Returns whether the user is in overtype mode.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_menu_option:
|
|
|
|
- void **menu_option** **(** :ref:`int<class_int>` option **)**
|
|
|
|
Triggers a right-click menu action by the specified index. See :ref:`MenuItems<enum_TextEdit_MenuItems>` for a list of available indexes.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_merge_gutters:
|
|
|
|
- void **merge_gutters** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)**
|
|
|
|
Merge the gutters from ``from_line`` into ``to_line``. Only overwritable gutters will be copied.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_paste:
|
|
|
|
- void **paste** **(** **)**
|
|
|
|
Paste at the current location. Can be overridden with :ref:`_paste<class_TextEdit_method__paste>`.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_redo:
|
|
|
|
- void **redo** **(** **)**
|
|
|
|
Perform redo operation.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_remove_gutter:
|
|
|
|
- void **remove_gutter** **(** :ref:`int<class_int>` gutter **)**
|
|
|
|
Removes the gutter from this ``TextEdit``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_remove_text:
|
|
|
|
- void **remove_text** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_column **)**
|
|
|
|
Removes text between the given positions.
|
|
|
|
\ **Note:** This does not adjust the caret or selection, which as a result it can end up in an invalid position.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_search:
|
|
|
|
- :ref:`Vector2i<class_Vector2i>` **search** **(** :ref:`String<class_String>` text, :ref:`int<class_int>` flags, :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_colum **)** |const|
|
|
|
|
Perform a search inside the text. Search flags can be specified in the :ref:`SearchFlags<enum_TextEdit_SearchFlags>` enum.
|
|
|
|
In the returned vector, ``x`` is the column, ``y`` is the line. If no results are found, both are equal to ``-1``.
|
|
|
|
|
|
.. tabs::
|
|
|
|
.. code-tab:: gdscript
|
|
|
|
var result = search("print", SEARCH_WHOLE_WORDS, 0, 0)
|
|
if result.x != -1:
|
|
# Result found.
|
|
var line_number = result.y
|
|
var column_number = result.x
|
|
|
|
.. code-tab:: csharp
|
|
|
|
Vector2i result = Search("print", (uint)TextEdit.SearchFlags.WholeWords, 0, 0);
|
|
if (result.Length > 0)
|
|
{
|
|
// Result found.
|
|
int lineNumber = result.y;
|
|
int columnNumber = result.x;
|
|
}
|
|
|
|
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_select:
|
|
|
|
- void **select** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` from_column, :ref:`int<class_int>` to_line, :ref:`int<class_int>` to_column **)**
|
|
|
|
Perform selection, from line/column to line/column.
|
|
|
|
If :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` is ``false``, no selection will occur.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_select_all:
|
|
|
|
- void **select_all** **(** **)**
|
|
|
|
Select all the text.
|
|
|
|
If :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` is ``false``, no selection will occur.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_select_word_under_caret:
|
|
|
|
- void **select_word_under_caret** **(** **)**
|
|
|
|
Selects the word under the caret.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_caret_column:
|
|
|
|
- void **set_caret_column** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` adjust_viewport=true **)**
|
|
|
|
Moves the caret to the specified ``column`` index.
|
|
|
|
If ``adjust_viewport`` is ``true``, the viewport will center at the caret position after the move occurs.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_caret_line:
|
|
|
|
- void **set_caret_line** **(** :ref:`int<class_int>` line, :ref:`bool<class_bool>` adjust_viewport=true, :ref:`bool<class_bool>` can_be_hidden=true, :ref:`int<class_int>` wrap_index=0 **)**
|
|
|
|
Moves the caret to the specified ``line`` index.
|
|
|
|
If ``adjust_viewport`` is ``true``, the viewport will center at the caret position after the move occurs.
|
|
|
|
If ``can_be_hidden`` is ``true``, the specified ``line`` can be hidden.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_gutter_clickable:
|
|
|
|
- void **set_gutter_clickable** **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` clickable **)**
|
|
|
|
Sets the gutter as clickable. This will change the mouse cursor to a pointing hand when hovering over the gutter.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_gutter_custom_draw:
|
|
|
|
- void **set_gutter_custom_draw** **(** :ref:`int<class_int>` column, :ref:`Callable<class_Callable>` draw_callback **)**
|
|
|
|
Set a custom draw method for the gutter. The callback method must take the following args: ``line: int, gutter: int, Area: Rect2``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_gutter_draw:
|
|
|
|
- void **set_gutter_draw** **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` draw **)**
|
|
|
|
Sets whether the gutter should be drawn.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_gutter_name:
|
|
|
|
- void **set_gutter_name** **(** :ref:`int<class_int>` gutter, :ref:`String<class_String>` name **)**
|
|
|
|
Sets the name of the gutter.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_gutter_overwritable:
|
|
|
|
- void **set_gutter_overwritable** **(** :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` overwritable **)**
|
|
|
|
Sets the gutter to overwritable. See :ref:`merge_gutters<class_TextEdit_method_merge_gutters>`.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_gutter_type:
|
|
|
|
- void **set_gutter_type** **(** :ref:`int<class_int>` gutter, :ref:`GutterType<enum_TextEdit_GutterType>` type **)**
|
|
|
|
Sets the type of gutter.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_gutter_width:
|
|
|
|
- void **set_gutter_width** **(** :ref:`int<class_int>` gutter, :ref:`int<class_int>` width **)**
|
|
|
|
Set the width of the gutter.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_line:
|
|
|
|
- void **set_line** **(** :ref:`int<class_int>` line, :ref:`String<class_String>` new_text **)**
|
|
|
|
Sets the text for a specific line.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_line_as_center_visible:
|
|
|
|
- void **set_line_as_center_visible** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)**
|
|
|
|
Positions the ``wrap_index`` of ``line`` at the center of the viewport.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_line_as_first_visible:
|
|
|
|
- void **set_line_as_first_visible** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)**
|
|
|
|
Positions the ``wrap_index`` of ``line`` at the top of the viewport.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_line_as_last_visible:
|
|
|
|
- void **set_line_as_last_visible** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` wrap_index=0 **)**
|
|
|
|
Positions the ``wrap_index`` of ``line`` at the bottom of the viewport.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_line_background_color:
|
|
|
|
- void **set_line_background_color** **(** :ref:`int<class_int>` line, :ref:`Color<class_Color>` color **)**
|
|
|
|
Sets the current background color of the line. Set to ``Color(0, 0, 0, 0)`` for no color.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_line_gutter_clickable:
|
|
|
|
- void **set_line_gutter_clickable** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`bool<class_bool>` clickable **)**
|
|
|
|
Sets the ``gutter`` on ``line`` as clickable.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_line_gutter_icon:
|
|
|
|
- void **set_line_gutter_icon** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Texture2D<class_Texture2D>` icon **)**
|
|
|
|
Sets the icon for ``gutter`` on ``line``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_line_gutter_item_color:
|
|
|
|
- void **set_line_gutter_item_color** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Color<class_Color>` color **)**
|
|
|
|
Sets the color for ``gutter`` on ``line``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_line_gutter_metadata:
|
|
|
|
- void **set_line_gutter_metadata** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`Variant<class_Variant>` metadata **)**
|
|
|
|
Sets the metadata for ``gutter`` on ``line``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_line_gutter_text:
|
|
|
|
- void **set_line_gutter_text** **(** :ref:`int<class_int>` line, :ref:`int<class_int>` gutter, :ref:`String<class_String>` text **)**
|
|
|
|
Sets the text for ``gutter`` on ``line``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_opentype_feature:
|
|
|
|
- void **set_opentype_feature** **(** :ref:`String<class_String>` tag, :ref:`int<class_int>` value **)**
|
|
|
|
Sets OpenType feature ``tag``. More info: `OpenType feature tags <https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags>`__.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_overtype_mode_enabled:
|
|
|
|
- void **set_overtype_mode_enabled** **(** :ref:`bool<class_bool>` enabled **)**
|
|
|
|
If ``true``, sets the user into overtype mode. When the user types in this mode, it will override existing text.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_search_flags:
|
|
|
|
- void **set_search_flags** **(** :ref:`int<class_int>` flags **)**
|
|
|
|
Sets the search flags. This is used with :ref:`set_search_text<class_TextEdit_method_set_search_text>` to highlight occurrences of the searched text. Search flags can be specified from the :ref:`SearchFlags<enum_TextEdit_SearchFlags>` enum.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_search_text:
|
|
|
|
- void **set_search_text** **(** :ref:`String<class_String>` search_text **)**
|
|
|
|
Sets the search text. See :ref:`set_search_flags<class_TextEdit_method_set_search_flags>`.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_selection_mode:
|
|
|
|
- void **set_selection_mode** **(** :ref:`SelectionMode<enum_TextEdit_SelectionMode>` mode, :ref:`int<class_int>` line=-1, :ref:`int<class_int>` column=-1 **)**
|
|
|
|
Sets the current selection mode.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_tab_size:
|
|
|
|
- void **set_tab_size** **(** :ref:`int<class_int>` size **)**
|
|
|
|
Sets the tab size for the ``TextEdit`` to use.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_set_tooltip_request_func:
|
|
|
|
- void **set_tooltip_request_func** **(** :ref:`Callable<class_Callable>` callback **)**
|
|
|
|
Provide custom tooltip text. The callback method must take the following args: ``hovered_word: String``
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_swap_lines:
|
|
|
|
- void **swap_lines** **(** :ref:`int<class_int>` from_line, :ref:`int<class_int>` to_line **)**
|
|
|
|
Swaps the two lines.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_tag_saved_version:
|
|
|
|
- void **tag_saved_version** **(** **)**
|
|
|
|
Tag the current version as saved.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_method_undo:
|
|
|
|
- void **undo** **(** **)**
|
|
|
|
Perform undo operation.
|
|
|
|
Theme Property Descriptions
|
|
---------------------------
|
|
|
|
.. _class_TextEdit_theme_color_background_color:
|
|
|
|
- :ref:`Color<class_Color>` **background_color**
|
|
|
|
+-----------+-----------------------+
|
|
| *Default* | ``Color(0, 0, 0, 0)`` |
|
|
+-----------+-----------------------+
|
|
|
|
Sets the background :ref:`Color<class_Color>` of this ``TextEdit``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_color_caret_background_color:
|
|
|
|
- :ref:`Color<class_Color>` **caret_background_color**
|
|
|
|
+-----------+-----------------------+
|
|
| *Default* | ``Color(0, 0, 0, 1)`` |
|
|
+-----------+-----------------------+
|
|
|
|
:ref:`Color<class_Color>` of the text behind the caret when using a block caret.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_color_caret_color:
|
|
|
|
- :ref:`Color<class_Color>` **caret_color**
|
|
|
|
+-----------+-----------------------------------+
|
|
| *Default* | ``Color(0.875, 0.875, 0.875, 1)`` |
|
|
+-----------+-----------------------------------+
|
|
|
|
:ref:`Color<class_Color>` of the caret. This can be set to a fully transparent color to hide the caret entirely.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_color_current_line_color:
|
|
|
|
- :ref:`Color<class_Color>` **current_line_color**
|
|
|
|
+-----------+----------------------------------+
|
|
| *Default* | ``Color(0.25, 0.25, 0.26, 0.8)`` |
|
|
+-----------+----------------------------------+
|
|
|
|
Background :ref:`Color<class_Color>` of the line containing the caret.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_color_font_color:
|
|
|
|
- :ref:`Color<class_Color>` **font_color**
|
|
|
|
+-----------+-----------------------------------+
|
|
| *Default* | ``Color(0.875, 0.875, 0.875, 1)`` |
|
|
+-----------+-----------------------------------+
|
|
|
|
Sets the font :ref:`Color<class_Color>`.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_color_font_outline_color:
|
|
|
|
- :ref:`Color<class_Color>` **font_outline_color**
|
|
|
|
+-----------+-----------------------+
|
|
| *Default* | ``Color(1, 1, 1, 1)`` |
|
|
+-----------+-----------------------+
|
|
|
|
The tint of text outline of the ``TextEdit``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_color_font_placeholder_color:
|
|
|
|
- :ref:`Color<class_Color>` **font_placeholder_color**
|
|
|
|
+-----------+-------------------------------------+
|
|
| *Default* | ``Color(0.875, 0.875, 0.875, 0.6)`` |
|
|
+-----------+-------------------------------------+
|
|
|
|
Font color for :ref:`placeholder_text<class_TextEdit_property_placeholder_text>`.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_color_font_readonly_color:
|
|
|
|
- :ref:`Color<class_Color>` **font_readonly_color**
|
|
|
|
+-----------+-------------------------------------+
|
|
| *Default* | ``Color(0.875, 0.875, 0.875, 0.5)`` |
|
|
+-----------+-------------------------------------+
|
|
|
|
Sets the font :ref:`Color<class_Color>` when :ref:`editable<class_TextEdit_property_editable>` is disabled.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_color_font_selected_color:
|
|
|
|
- :ref:`Color<class_Color>` **font_selected_color**
|
|
|
|
+-----------+-----------------------+
|
|
| *Default* | ``Color(1, 1, 1, 1)`` |
|
|
+-----------+-----------------------+
|
|
|
|
Sets the :ref:`Color<class_Color>` of the selected text. :ref:`override_selected_font_color<class_TextEdit_property_override_selected_font_color>` has to be enabled.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_color_search_result_border_color:
|
|
|
|
- :ref:`Color<class_Color>` **search_result_border_color**
|
|
|
|
+-----------+-------------------------------+
|
|
| *Default* | ``Color(0.3, 0.3, 0.3, 0.4)`` |
|
|
+-----------+-------------------------------+
|
|
|
|
:ref:`Color<class_Color>` of the border around text that matches the search query.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_color_search_result_color:
|
|
|
|
- :ref:`Color<class_Color>` **search_result_color**
|
|
|
|
+-----------+-----------------------------+
|
|
| *Default* | ``Color(0.3, 0.3, 0.3, 1)`` |
|
|
+-----------+-----------------------------+
|
|
|
|
:ref:`Color<class_Color>` behind the text that matches the search query.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_color_selection_color:
|
|
|
|
- :ref:`Color<class_Color>` **selection_color**
|
|
|
|
+-----------+-----------------------------+
|
|
| *Default* | ``Color(0.5, 0.5, 0.5, 1)`` |
|
|
+-----------+-----------------------------+
|
|
|
|
Sets the highlight :ref:`Color<class_Color>` of text selections.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_color_word_highlighted_color:
|
|
|
|
- :ref:`Color<class_Color>` **word_highlighted_color**
|
|
|
|
+-----------+--------------------------------+
|
|
| *Default* | ``Color(0.5, 0.5, 0.5, 0.25)`` |
|
|
+-----------+--------------------------------+
|
|
|
|
Sets the highlight :ref:`Color<class_Color>` of multiple occurrences. :ref:`highlight_all_occurrences<class_TextEdit_property_highlight_all_occurrences>` has to be enabled.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_constant_caret_width:
|
|
|
|
- :ref:`int<class_int>` **caret_width**
|
|
|
|
+-----------+-------+
|
|
| *Default* | ``1`` |
|
|
+-----------+-------+
|
|
|
|
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. If set to ``0`` or lower, the caret width is automatically set to 1 pixel and multiplied by the display scaling factor.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_constant_line_spacing:
|
|
|
|
- :ref:`int<class_int>` **line_spacing**
|
|
|
|
+-----------+-------+
|
|
| *Default* | ``4`` |
|
|
+-----------+-------+
|
|
|
|
Sets the spacing between the lines.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_constant_outline_size:
|
|
|
|
- :ref:`int<class_int>` **outline_size**
|
|
|
|
+-----------+-------+
|
|
| *Default* | ``0`` |
|
|
+-----------+-------+
|
|
|
|
The size of the text outline.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_font_font:
|
|
|
|
- :ref:`Font<class_Font>` **font**
|
|
|
|
Sets the default :ref:`Font<class_Font>`.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_font_size_font_size:
|
|
|
|
- :ref:`int<class_int>` **font_size**
|
|
|
|
Sets default font size.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_icon_space:
|
|
|
|
- :ref:`Texture2D<class_Texture2D>` **space**
|
|
|
|
Sets a custom :ref:`Texture2D<class_Texture2D>` for space text characters.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_icon_tab:
|
|
|
|
- :ref:`Texture2D<class_Texture2D>` **tab**
|
|
|
|
Sets a custom :ref:`Texture2D<class_Texture2D>` for tab text characters.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_style_focus:
|
|
|
|
- :ref:`StyleBox<class_StyleBox>` **focus**
|
|
|
|
Sets the :ref:`StyleBox<class_StyleBox>` when in focus. The ``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.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_style_normal:
|
|
|
|
- :ref:`StyleBox<class_StyleBox>` **normal**
|
|
|
|
Sets the :ref:`StyleBox<class_StyleBox>` of this ``TextEdit``.
|
|
|
|
----
|
|
|
|
.. _class_TextEdit_theme_style_read_only:
|
|
|
|
- :ref:`StyleBox<class_StyleBox>` **read_only**
|
|
|
|
Sets the :ref:`StyleBox<class_StyleBox>` of this ``TextEdit`` when :ref:`editable<class_TextEdit_property_editable>` is disabled.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|
|
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
|
|
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|
|
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|