.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_TextEdit: TextEdit ======== **Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Multiline text editing control. Member Functions ---------------- +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_color_region` **(** :ref:`String` begin_key, :ref:`String` end_key, :ref:`Color` color, :ref:`bool` line_only=null **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_keyword_color` **(** :ref:`String` keyword, :ref:`Color` color **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_colors` **(** **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_undo_history` **(** **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`copy` **(** **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`cursor_get_blink_enabled` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`cursor_get_blink_speed` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`cursor_get_column` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`cursor_get_line` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`cursor_is_block_mode` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`cursor_set_blink_enabled` **(** :ref:`bool` enable **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`cursor_set_blink_speed` **(** :ref:`float` blink_speed **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`cursor_set_block_mode` **(** :ref:`bool` enable **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`cursor_set_column` **(** :ref:`int` column, :ref:`bool` adjust_viewport=null **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`cursor_set_line` **(** :ref:`int` line, :ref:`bool` adjust_viewport=null **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`cut` **(** **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_line` **(** :ref:`int` line **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_line_count` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PopupMenu` | :ref:`get_menu` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selection_from_column` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selection_from_line` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_selection_text` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selection_to_column` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selection_to_line` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_text` **(** **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_v_scroll_speed` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_word_under_cursor` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`insert_text_at_cursor` **(** :ref:`String` text **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_highlight_all_occurrences_enabled` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_selection_active` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_show_line_numbers_enabled` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_smooth_scroll_enabled` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_syntax_coloring_enabled` **(** **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`menu_option` **(** :ref:`int` option **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`paste` **(** **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`redo` **(** **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolIntArray` | :ref:`search` **(** :ref:`String` key, :ref:`int` flags, :ref:`int` from_line, :ref:`int` from_column **)** const | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`select` **(** :ref:`int` from_line, :ref:`int` from_column, :ref:`int` to_line, :ref:`int` to_column **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`select_all` **(** **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_highlight_all_occurrences` **(** :ref:`bool` enable **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_max_chars` **(** :ref:`int` amount **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_readonly` **(** :ref:`bool` enable **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_show_line_numbers` **(** :ref:`bool` enable **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_smooth_scroll_enable` **(** :ref:`bool` enable **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_syntax_coloring` **(** :ref:`bool` enable **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_text` **(** :ref:`String` text **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_v_scroll_speed` **(** :ref:`float` speed **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_wrap` **(** :ref:`bool` enable **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`undo` **(** **)** | +------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- - **breakpoint_toggled** **(** :ref:`int` row **)** Emitted when a breakpoint is placed via the breakpoint gutter. - **cursor_changed** **(** **)** Emitted when the cursor changes. - **request_completion** **(** **)** - **symbol_lookup** **(** :ref:`String` symbol, :ref:`int` row, :ref:`int` column **)** - **text_changed** **(** **)** Emitted when the text changes. Numeric Constants ----------------- - **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. - **MENU_CUT** = **0** - **MENU_COPY** = **1** - **MENU_PASTE** = **2** - **MENU_CLEAR** = **3** - **MENU_SELECT_ALL** = **4** - **MENU_UNDO** = **5** - **MENU_MAX** = **6** 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. Member Function Description --------------------------- .. _class_TextEdit_add_color_region: - void **add_color_region** **(** :ref:`String` begin_key, :ref:`String` end_key, :ref:`Color` color, :ref:`bool` line_only=null **)** Add color region (given the delimiters) and its colors. .. _class_TextEdit_add_keyword_color: - void **add_keyword_color** **(** :ref:`String` keyword, :ref:`Color` color **)** Add a keyword and its color. .. _class_TextEdit_clear_colors: - void **clear_colors** **(** **)** Clear all the syntax coloring information. .. _class_TextEdit_clear_undo_history: - void **clear_undo_history** **(** **)** Clear the undo history. .. _class_TextEdit_copy: - void **copy** **(** **)** Copy the current selection. .. _class_TextEdit_cursor_get_blink_enabled: - :ref:`bool` **cursor_get_blink_enabled** **(** **)** const Gets whether the text editor caret is blinking. .. _class_TextEdit_cursor_get_blink_speed: - :ref:`float` **cursor_get_blink_speed** **(** **)** const Gets the text editor caret blink speed. .. _class_TextEdit_cursor_get_column: - :ref:`int` **cursor_get_column** **(** **)** const Return the column the editing cursor is at. .. _class_TextEdit_cursor_get_line: - :ref:`int` **cursor_get_line** **(** **)** const Return the line the editing cursor is at. .. _class_TextEdit_cursor_is_block_mode: - :ref:`bool` **cursor_is_block_mode** **(** **)** const Gets whether the text editor caret is in block mode. .. _class_TextEdit_cursor_set_blink_enabled: - void **cursor_set_blink_enabled** **(** :ref:`bool` enable **)** Set the text editor caret to blink. .. _class_TextEdit_cursor_set_blink_speed: - void **cursor_set_blink_speed** **(** :ref:`float` blink_speed **)** Set the text editor caret blink speed. Cannot be less then or equal to 0. .. _class_TextEdit_cursor_set_block_mode: - void **cursor_set_block_mode** **(** :ref:`bool` enable **)** Set the text editor caret to block mode. .. _class_TextEdit_cursor_set_column: - void **cursor_set_column** **(** :ref:`int` column, :ref:`bool` adjust_viewport=null **)** .. _class_TextEdit_cursor_set_line: - void **cursor_set_line** **(** :ref:`int` line, :ref:`bool` adjust_viewport=null **)** .. _class_TextEdit_cut: - void **cut** **(** **)** Cut the current selection. .. _class_TextEdit_get_line: - :ref:`String` **get_line** **(** :ref:`int` line **)** const Return the text of a specific line. .. _class_TextEdit_get_line_count: - :ref:`int` **get_line_count** **(** **)** const Return the amount of total lines in the text. .. _class_TextEdit_get_menu: - :ref:`PopupMenu` **get_menu** **(** **)** const .. _class_TextEdit_get_selection_from_column: - :ref:`int` **get_selection_from_column** **(** **)** const Return the selection begin column. .. _class_TextEdit_get_selection_from_line: - :ref:`int` **get_selection_from_line** **(** **)** const Return the selection begin line. .. _class_TextEdit_get_selection_text: - :ref:`String` **get_selection_text** **(** **)** const Return the text inside the selection. .. _class_TextEdit_get_selection_to_column: - :ref:`int` **get_selection_to_column** **(** **)** const Return the selection end column. .. _class_TextEdit_get_selection_to_line: - :ref:`int` **get_selection_to_line** **(** **)** const Return the selection end line. .. _class_TextEdit_get_text: - :ref:`String` **get_text** **(** **)** Return the whole text. .. _class_TextEdit_get_v_scroll_speed: - :ref:`float` **get_v_scroll_speed** **(** **)** const .. _class_TextEdit_get_word_under_cursor: - :ref:`String` **get_word_under_cursor** **(** **)** const .. _class_TextEdit_insert_text_at_cursor: - void **insert_text_at_cursor** **(** :ref:`String` text **)** Insert a given text at the cursor position. .. _class_TextEdit_is_highlight_all_occurrences_enabled: - :ref:`bool` **is_highlight_all_occurrences_enabled** **(** **)** const Returns true if highlight all occurrences is enabled. .. _class_TextEdit_is_selection_active: - :ref:`bool` **is_selection_active** **(** **)** const Return true if the selection is active. .. _class_TextEdit_is_show_line_numbers_enabled: - :ref:`bool` **is_show_line_numbers_enabled** **(** **)** const Returns true if line numbers are enabled. .. _class_TextEdit_is_smooth_scroll_enabled: - :ref:`bool` **is_smooth_scroll_enabled** **(** **)** const .. _class_TextEdit_is_syntax_coloring_enabled: - :ref:`bool` **is_syntax_coloring_enabled** **(** **)** const Return true if the syntax coloring is enabled. .. _class_TextEdit_menu_option: - void **menu_option** **(** :ref:`int` option **)** .. _class_TextEdit_paste: - void **paste** **(** **)** Paste the current selection. .. _class_TextEdit_redo: - void **redo** **(** **)** Perform redo operation. .. _class_TextEdit_search: - :ref:`PoolIntArray` **search** **(** :ref:`String` key, :ref:`int` flags, :ref:`int` from_line, :ref:`int` from_column **)** const Perform a search inside the text. Search flags can be specified in the SEARCH\_\* enum. .. _class_TextEdit_select: - void **select** **(** :ref:`int` from_line, :ref:`int` from_column, :ref:`int` to_line, :ref:`int` to_column **)** Perform selection, from line/column to line/column. .. _class_TextEdit_select_all: - void **select_all** **(** **)** Select all the text. .. _class_TextEdit_set_highlight_all_occurrences: - void **set_highlight_all_occurrences** **(** :ref:`bool` enable **)** Set to enable highlighting all occurrences of the current selection. .. _class_TextEdit_set_max_chars: - void **set_max_chars** **(** :ref:`int` amount **)** Set the maximum amount of characters editable. .. _class_TextEdit_set_readonly: - void **set_readonly** **(** :ref:`bool` enable **)** Set the text editor as read-only. Text can be displayed but not edited. .. _class_TextEdit_set_show_line_numbers: - void **set_show_line_numbers** **(** :ref:`bool` enable **)** Set to enable showing line numbers. .. _class_TextEdit_set_smooth_scroll_enable: - void **set_smooth_scroll_enable** **(** :ref:`bool` enable **)** .. _class_TextEdit_set_syntax_coloring: - void **set_syntax_coloring** **(** :ref:`bool` enable **)** Set to enable the syntax coloring. .. _class_TextEdit_set_text: - void **set_text** **(** :ref:`String` text **)** Set the entire text. .. _class_TextEdit_set_v_scroll_speed: - void **set_v_scroll_speed** **(** :ref:`float` speed **)** .. _class_TextEdit_set_wrap: - void **set_wrap** **(** :ref:`bool` enable **)** Enable text wrapping when it goes beyond he edge of what is visible. .. _class_TextEdit_undo: - void **undo** **(** **)** Perform undo operation.