Up to date
This page is up to date for Godot 4.0
.
If you still find outdated information, please open an issue.
TextEditΒΆ
Inherits: Control < CanvasItem < Node < Object
Inherited By: 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: Most viewport, caret and edit methods contain a caret_index
argument for caret_multiple support. The argument should be one of the following: -1
for all carets, 0
for the main caret, or greater than 0
for secondary carets.
Note: When holding down 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ΒΆ
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
focus_mode |
|
|
|
||
|
||
|
||
|
||
|
||
|
||
mouse_default_cursor_shape |
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
MethodsΒΆ
void |
_backspace ( int caret_index ) virtual |
void |
|
void |
|
void |
_handle_unicode_input ( int unicode_char, int caret_index ) virtual |
void |
|
void |
_paste_primary_clipboard ( int caret_index ) virtual |
void |
add_caret_at_carets ( bool below ) |
void |
add_gutter ( int at=-1 ) |
void |
|
void |
adjust_carets_after_edit ( int caret, int from_line, int from_col, int to_line, int to_col ) |
void |
adjust_viewport_to_caret ( int caret_index=0 ) |
void |
|
void |
|
void |
center_viewport_to_caret ( int caret_index=0 ) |
void |
clear ( ) |
void |
|
void |
|
void |
|
void |
delete_selection ( int caret_index=-1 ) |
void |
|
void |
end_action ( ) |
void |
|
get_caret_column ( int caret_index=0 ) const |
|
get_caret_count ( ) const |
|
get_caret_draw_pos ( int caret_index=0 ) const |
|
get_caret_line ( int caret_index=0 ) const |
|
get_caret_wrap_index ( int caret_index=0 ) const |
|
get_first_non_whitespace_column ( int line ) const |
|
get_first_visible_line ( ) const |
|
get_gutter_count ( ) const |
|
get_gutter_name ( int gutter ) const |
|
get_gutter_type ( int gutter ) const |
|
get_gutter_width ( int gutter ) const |
|
get_h_scroll_bar ( ) const |
|
get_indent_level ( int line ) const |
|
get_last_full_visible_line ( ) const |
|
get_last_full_visible_line_wrap_index ( ) const |
|
get_last_unhidden_line ( ) const |
|
get_line_background_color ( int line ) const |
|
get_line_column_at_pos ( Vector2i position, bool allow_out_of_bounds=true ) const |
|
get_line_count ( ) const |
|
get_line_gutter_icon ( int line, int gutter ) const |
|
get_line_gutter_item_color ( int line, int gutter ) const |
|
get_line_gutter_metadata ( int line, int gutter ) const |
|
get_line_gutter_text ( int line, int gutter ) const |
|
get_line_height ( ) const |
|
get_line_width ( int line, int wrap_index=-1 ) const |
|
get_line_wrap_count ( int line ) const |
|
get_line_wrap_index_at_column ( int line, int column ) const |
|
get_line_wrapped_text ( int line ) const |
|
get_local_mouse_pos ( ) const |
|
get_menu ( ) const |
|
get_minimap_line_at_pos ( Vector2i position ) const |
|
get_minimap_visible_lines ( ) const |
|
get_next_visible_line_index_offset_from ( int line, int wrap_index, int visible_amount ) const |
|
get_next_visible_line_offset_from ( int line, int visible_amount ) const |
|
get_pos_at_line_column ( int line, int column ) const |
|
get_rect_at_line_column ( int line, int column ) const |
|
get_saved_version ( ) const |
|
get_scroll_pos_for_line ( int line, int wrap_index=0 ) const |
|
get_selected_text ( int caret_index=-1 ) |
|
get_selection_column ( int caret_index=0 ) const |
|
get_selection_from_column ( int caret_index=0 ) const |
|
get_selection_from_line ( int caret_index=0 ) const |
|
get_selection_line ( int caret_index=0 ) const |
|
get_selection_mode ( ) const |
|
get_selection_to_column ( int caret_index=0 ) const |
|
get_selection_to_line ( int caret_index=0 ) const |
|
get_tab_size ( ) const |
|
get_total_gutter_width ( ) const |
|
get_total_visible_line_count ( ) const |
|
get_v_scroll_bar ( ) const |
|
get_version ( ) const |
|
get_visible_line_count ( ) const |
|
get_visible_line_count_in_range ( int from_line, int to_line ) const |
|
get_word_at_pos ( Vector2 position ) const |
|
get_word_under_caret ( int caret_index=-1 ) const |
|
has_ime_text ( ) const |
|
has_redo ( ) const |
|
has_selection ( int caret_index=-1 ) const |
|
has_undo ( ) const |
|
void |
insert_line_at ( int line, String text ) |
void |
insert_text_at_caret ( String text, int caret_index=-1 ) |
is_caret_visible ( int caret_index=0 ) const |
|
is_dragging_cursor ( ) const |
|
is_gutter_clickable ( int gutter ) const |
|
is_gutter_drawn ( int gutter ) const |
|
is_gutter_overwritable ( int gutter ) const |
|
is_line_gutter_clickable ( int line, int gutter ) const |
|
is_line_wrapped ( int line ) const |
|
is_menu_visible ( ) const |
|
is_mouse_over_selection ( bool edges, int caret_index=-1 ) const |
|
is_overtype_mode_enabled ( ) const |
|
void |
menu_option ( int option ) |
void |
merge_gutters ( int from_line, int to_line ) |
void |
|
void |
|
void |
paste_primary_clipboard ( int caret_index=-1 ) |
void |
redo ( ) |
void |
remove_caret ( int caret ) |
void |
remove_gutter ( int gutter ) |
void |
|
void |
remove_text ( int from_line, int from_column, int to_line, int to_column ) |
search ( String text, int flags, int from_line, int from_colum ) const |
|
void |
select ( int from_line, int from_column, int to_line, int to_column, int caret_index=0 ) |
void |
select_all ( ) |
void |
select_word_under_caret ( int caret_index=-1 ) |
void |
set_caret_column ( int column, bool adjust_viewport=true, int caret_index=0 ) |
void |
set_caret_line ( int line, bool adjust_viewport=true, bool can_be_hidden=true, int wrap_index=0, int caret_index=0 ) |
void |
set_gutter_clickable ( int gutter, bool clickable ) |
void |
set_gutter_custom_draw ( int column, Callable draw_callback ) |
void |
set_gutter_draw ( int gutter, bool draw ) |
void |
set_gutter_name ( int gutter, String name ) |
void |
set_gutter_overwritable ( int gutter, bool overwritable ) |
void |
set_gutter_type ( int gutter, GutterType type ) |
void |
set_gutter_width ( int gutter, int width ) |
void |
|
void |
set_line_as_center_visible ( int line, int wrap_index=0 ) |
void |
set_line_as_first_visible ( int line, int wrap_index=0 ) |
void |
set_line_as_last_visible ( int line, int wrap_index=0 ) |
void |
set_line_background_color ( int line, Color color ) |
void |
set_line_gutter_clickable ( int line, int gutter, bool clickable ) |
void |
set_line_gutter_icon ( int line, int gutter, Texture2D icon ) |
void |
set_line_gutter_item_color ( int line, int gutter, Color color ) |
void |
set_line_gutter_metadata ( int line, int gutter, Variant metadata ) |
void |
set_line_gutter_text ( int line, int gutter, String text ) |
void |
set_overtype_mode_enabled ( bool enabled ) |
void |
set_search_flags ( int flags ) |
void |
set_search_text ( String search_text ) |
void |
set_selection_mode ( SelectionMode mode, int line=-1, int column=-1, int caret_index=0 ) |
void |
set_tab_size ( int size ) |
void |
set_tooltip_request_func ( Callable callback ) |
void |
start_action ( EditAction action ) |
void |
swap_lines ( int from_line, int to_line ) |
void |
|
void |
undo ( ) |
Theme PropertiesΒΆ
|
||
|
||
|
||
|
||
|
||
|
||