TextEdit
Hereda: Control < CanvasItem < Node < Object
Heredado por: CodeEdit
Un editor de texto multilínea.
Descripción
A multiline text editor. It also has limited facilities for editing code, such as syntax highlighting support. For more advanced facilities for editing code, see CodeEdit.
While entering text, it is possible to insert special characters using Unicode, OEM or Windows alt codes:
To enter Unicode codepoints, hold Alt and type the codepoint on the numpad. For example, to enter the character
á(U+00E1), hold Alt and type +E1 on the numpad (the leading zeroes can be omitted).To enter OEM codepoints, hold Alt and type the code on the numpad. For example, to enter the character
á(OEM 160), hold Alt and type160on the numpad.To enter Windows codepoints, hold Alt and type the code on the numpad. For example, to enter the character
á(Windows 0225), hold Alt and type 0, 2, 2, 5 on the numpad. The leading zero here must not be omitted, as this is how Windows codepoints are distinguished from OEM codepoints.
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 in the order they were created.
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.
Propiedades
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
clip_contents |
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
focus_mode |
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
mouse_default_cursor_shape |
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Métodos
void |
_backspace(caret_index: int) virtual |
void |
|
void |
|
void |
_handle_unicode_input(unicode_char: int, caret_index: int) virtual |
void |
|
void |
_paste_primary_clipboard(caret_index: int) virtual |
void |
add_caret_at_carets(below: bool) |
void |
add_gutter(at: int = -1) |
void |
|
void |
adjust_carets_after_edit(caret: int, from_line: int, from_col: int, to_line: int, to_col: int) |
void |
adjust_viewport_to_caret(caret_index: int = 0) |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
center_viewport_to_caret(caret_index: int = 0) |
void |
clear() |
void |
|
void |
collapse_carets(from_line: int, from_column: int, to_line: int, to_column: int, inclusive: bool = false) |
void |
|
void |
|
void |
delete_selection(caret_index: int = -1) |
void |
|
void |
|
void |
|
void |
|
get_caret_column(caret_index: int = 0) const |
|
get_caret_count() const |
|
get_caret_draw_pos(caret_index: int = 0) const |
|
get_caret_line(caret_index: int = 0) const |
|
get_caret_wrap_index(caret_index: int = 0) const |
|
get_first_non_whitespace_column(line: int) const |
|
get_first_visible_line() const |
|
get_gutter_count() const |
|
get_gutter_name(gutter: int) const |
|
get_gutter_type(gutter: int) const |
|
get_gutter_width(gutter: int) const |
|
get_h_scroll_bar() const |
|
get_indent_level(line: int) const |
|
get_last_full_visible_line() const |
|
get_last_unhidden_line() const |
|
get_line_background_color(line: int) const |
|
get_line_column_at_pos(position: Vector2i, clamp_line: bool = true, clamp_column: bool = true) const |
|
get_line_count() const |
|
get_line_gutter_icon(line: int, gutter: int) const |
|
get_line_gutter_item_color(line: int, gutter: int) const |
|
get_line_gutter_metadata(line: int, gutter: int) const |
|
get_line_gutter_text(line: int, gutter: int) const |
|
get_line_height() const |
|
get_line_ranges_from_carets(only_selections: bool = false, merge_adjacent: bool = true) const |
|
get_line_width(line: int, wrap_index: int = -1) const |
|
get_line_with_ime(line: int) const |
|
get_line_wrap_count(line: int) const |
|
get_line_wrap_index_at_column(line: int, column: int) const |
|
get_line_wrapped_text(line: int) const |
|
get_local_mouse_pos() const |
|
get_menu() const |
|
get_minimap_line_at_pos(position: Vector2i) const |
|
get_minimap_visible_lines() const |
|
get_next_composite_character_column(line: int, column: int) const |
|
get_next_visible_line_index_offset_from(line: int, wrap_index: int, visible_amount: int) const |
|
get_next_visible_line_offset_from(line: int, visible_amount: int) const |
|
get_pos_at_line_column(line: int, column: int) const |
|
get_previous_composite_character_column(line: int, column: int) const |
|
get_rect_at_line_column(line: int, column: int) const |
|
get_saved_version() const |
|
get_scroll_pos_for_line(line: int, wrap_index: int = 0) const |
|
get_selected_text(caret_index: int = -1) |
|
get_selection_at_line_column(line: int, column: int, include_edges: bool = true, only_selections: bool = true) const |
|
get_selection_column(caret_index: int = 0) const |
|
get_selection_from_column(caret_index: int = 0) const |
|
get_selection_from_line(caret_index: int = 0) const |
|
get_selection_line(caret_index: int = 0) const |
|
get_selection_mode() const |
|
get_selection_origin_column(caret_index: int = 0) const |
|
get_selection_origin_line(caret_index: int = 0) const |
|
get_selection_to_column(caret_index: int = 0) const |
|
get_selection_to_line(caret_index: int = 0) const |
|
get_sorted_carets(include_ignored_carets: bool = false) 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(from_line: int, to_line: int) const |
|
get_word_at_pos(position: Vector2) const |
|
get_word_under_caret(caret_index: int = -1) const |
|
has_ime_text() const |
|
has_redo() const |
|
has_selection(caret_index: int = -1) const |
|
has_undo() const |
|
void |
insert_line_at(line: int, text: String) |
void |
insert_text(text: String, line: int, column: int, before_selection_begin: bool = true, before_selection_end: bool = false) |
void |
insert_text_at_caret(text: String, caret_index: int = -1) |
is_caret_after_selection_origin(caret_index: int = 0) const |
|
is_caret_visible(caret_index: int = 0) const |
|
is_dragging_cursor() const |
|
is_gutter_clickable(gutter: int) const |
|
is_gutter_drawn(gutter: int) const |
|
is_gutter_overwritable(gutter: int) const |
|
is_in_mulitcaret_edit() const |
|
is_line_gutter_clickable(line: int, gutter: int) const |
|
is_line_wrapped(line: int) const |
|
is_menu_visible() const |
|
is_mouse_over_selection(edges: bool, caret_index: int = -1) const |
|
is_overtype_mode_enabled() const |
|
void |
menu_option(option: int) |
void |
merge_gutters(from_line: int, to_line: int) |
void |
|
multicaret_edit_ignore_caret(caret_index: int) const |
|
void |
|
void |
paste_primary_clipboard(caret_index: int = -1) |
void |
redo() |
void |
remove_caret(caret: int) |
void |
remove_gutter(gutter: int) |
void |
remove_line_at(line: int, move_carets_down: bool = true) |
void |
|
void |
remove_text(from_line: int, from_column: int, to_line: int, to_column: int) |
search(text: String, flags: int, from_line: int, from_column: int) const |
|
void |
select(origin_line: int, origin_column: int, caret_line: int, caret_column: int, caret_index: int = 0) |
void |
|
void |
select_word_under_caret(caret_index: int = -1) |
void |
set_caret_column(column: int, adjust_viewport: bool = true, caret_index: int = 0) |
void |
set_caret_line(line: int, adjust_viewport: bool = true, can_be_hidden: bool = true, wrap_index: int = 0, caret_index: int = 0) |
void |
set_gutter_clickable(gutter: int, clickable: bool) |
void |
set_gutter_custom_draw(column: int, draw_callback: Callable) |
void |
set_gutter_draw(gutter: int, draw: bool) |
void |
set_gutter_name(gutter: int, name: String) |
void |
set_gutter_overwritable(gutter: int, overwritable: bool) |
void |
set_gutter_type(gutter: int, type: GutterType) |
void |
set_gutter_width(gutter: int, width: int) |
void |
|
void |
set_line_as_center_visible(line: int, wrap_index: int = 0) |
void |
set_line_as_first_visible(line: int, wrap_index: int = 0) |
void |
set_line_as_last_visible(line: int, wrap_index: int = 0) |
void |
set_line_background_color(line: int, color: Color) |
void |
set_line_gutter_clickable(line: int, gutter: int, clickable: bool) |
void |
set_line_gutter_icon(line: int, gutter: int, icon: Texture2D) |
void |
set_line_gutter_item_color(line: int, gutter: int, color: Color) |
void |
set_line_gutter_metadata(line: int, gutter: int, metadata: Variant) |
void |
set_line_gutter_text(line: int, gutter: int, text: String) |
void |
set_overtype_mode_enabled(enabled: bool) |
void |
set_search_flags(flags: int) |
void |
set_search_text(search_text: String) |
void |
set_selection_mode(mode: SelectionMode) |
void |
set_selection_origin_column(column: int, caret_index: int = 0) |
void |
set_selection_origin_line(line: int, can_be_hidden: bool = true, wrap_index: int = -1, caret_index: int = 0) |
void |
set_tab_size(size: int) |
void |
set_tooltip_request_func(callback: Callable) |
void |
|
void |
start_action(action: EditAction) |
void |
swap_lines(from_line: int, to_line: int) |
void |
|
void |
undo() |
Propiedades del Tema
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Señales
caret_changed() 🔗
Emitida cuando cualquier cursor cambia de posición.
gutter_added() 🔗
Emitted when a gutter is added.
gutter_clicked(line: int, gutter: int) 🔗
Emitida cuando se cierra una pestaña.
gutter_removed() 🔗
Emitted when a gutter is removed.
lines_edited_from(from_line: int, to_line: int) 🔗
Emitted immediately when the text changes.
When text is added from_line will be less than to_line. On a remove to_line will be less than from_line.
text_changed() 🔗
Emitida cuando el texto cambia.
text_set() 🔗
Enumeraciones
Corta (copia y borra) el texto seleccionado.
Copia el texto seleccionado.
Pega el texto del portapapeles sobre el texto seleccionado (o en la posición del cursor).
Borra todo el texto TextEdit.
Selecciona todo el texto TextEdit.
Deshace la acción anterior.
Rehace la acción anterior.
ID del submenú "Dirección de escritura del texto".
Establece la dirección del texto como heredada.
Establece la dirección del texto en automática.
Establece la dirección del texto de izquierda a derecha.
Establece la dirección del texto de derecha a izquierda.
Alterna la visualización de los caracteres de control.
ID del submenú "Insertar carácter de control".
Inserta el carácter de marca de izquierda a derecha (LRM).
Inserta el carácter de marca de derecha a izquierda (RLM).
Inserta el carácter de inicio de incrustación de izquierda a derecha (LRE).
Inserta el carácter de inicio de incrustación de derecha a izquierda (RLE).
Inserta el carácter de inicio de sobrescritura de izquierda a derecha (LRO).
Inserta el carácter de inicio de sobrescritura de derecha a izquierda (RLO).
Inserta el carácter de formato de dirección emergente (PDF).
Inserta el carácter de marca de letra árabe (ALM).
Inserta el carácter de aislamiento de izquierda a derecha (LRI).
Inserta el carácter de aislamiento de derecha a izquierda (RLI).
Inserta el primer carácter de aislamiento fuerte (FSI).
Inserta el carácter de aislamiento de dirección emergente (PDI).
Inserta el carácter de unión de ancho cero (ZWJ).
Inserta el carácter de no unión de ancho cero (ZWNJ).
Inserta el carácter de unión de palabras (WJ).
Inserta el carácter de guion suave (SHY).
Abre el selector de emojis y símbolos del sistema.
Representa el tamaño del enum MenuItems.
enum EditAction: 🔗
EditAction ACTION_NONE = 0
Ninguna acción actual.
EditAction ACTION_TYPING = 1
Una acción de mecanografía.
EditAction ACTION_BACKSPACE = 2
A backwards delete action.
EditAction ACTION_DELETE = 3
Una acción de eliminación hacia adelante.
enum SearchFlags: 🔗
SearchFlags SEARCH_MATCH_CASE = 1
Coincide con el caso cuando se busca.
SearchFlags SEARCH_WHOLE_WORDS = 2
Coincide con palabras enteras cuando se busca.
SearchFlags SEARCH_BACKWARDS = 4
Busca desde el final hasta el principio.
enum CaretType: 🔗
CaretType CARET_TYPE_LINE = 0
Cursor de línea vertical.
CaretType CARET_TYPE_BLOCK = 1
Cursor de bloque.
enum SelectionMode: 🔗
SelectionMode SELECTION_MODE_NONE = 0
No seleccionado.
SelectionMode SELECTION_MODE_SHIFT = 1
Select as if shift is pressed.
SelectionMode SELECTION_MODE_POINTER = 2
Select single characters as if the user single clicked.
SelectionMode SELECTION_MODE_WORD = 3
Select whole words as if the user double clicked.
SelectionMode SELECTION_MODE_LINE = 4
Select whole lines as if the user triple clicked.
enum LineWrappingMode: 🔗
LineWrappingMode LINE_WRAPPING_NONE = 0
El ajuste de línea está deshabilitado.
LineWrappingMode LINE_WRAPPING_BOUNDARY = 1
Line wrapping occurs at the control boundary, beyond what would normally be visible.
enum GutterType: 🔗
GutterType GUTTER_TYPE_STRING = 0
When a gutter is set to string using set_gutter_type(), it is used to contain text set via the set_line_gutter_text() method.
GutterType GUTTER_TYPE_ICON = 1
When a gutter is set to icon using set_gutter_type(), it is used to contain an icon set via the set_line_gutter_icon() method.
GutterType GUTTER_TYPE_CUSTOM = 2
When a gutter is set to custom using set_gutter_type(), it is used to contain custom visuals controlled by a callback method set via the set_gutter_custom_draw() method.
Descripciones de Propiedades
AutowrapMode autowrap_mode = 3 🔗
void set_autowrap_mode(value: AutowrapMode)
AutowrapMode get_autowrap_mode()
If wrap_mode is set to LINE_WRAPPING_BOUNDARY, sets text wrapping mode.
bool backspace_deletes_composite_character_enabled = false 🔗
void set_backspace_deletes_composite_character_enabled(value: bool)
bool is_backspace_deletes_composite_character_enabled()
Si es true, y caret_mid_grapheme es false, la tecla de retroceso elimina un carácter compuesto completo como ❤️🩹, en lugar de eliminar parte del carácter compuesto.
Si es true, el cursor visual parpadea.
float caret_blink_interval = 0.65 🔗
El intervalo en el que el cursor parpadea (en segundos).
bool caret_draw_when_editable_disabled = false 🔗
void set_draw_caret_when_editable_disabled(value: bool)
bool is_drawing_caret_when_editable_disabled()
Si es true, el cursor será visible cuando editable esté deshabilitado.
bool caret_mid_grapheme = false 🔗
Permite mover el cursor, seleccionar y eliminar los componentes individuales de caracteres compuestos.
Nota: Retroceso siempre elimina los componentes individuales de caracteres compuestos.
bool caret_move_on_right_click = true 🔗
If true, a right-click moves the caret at the mouse position before displaying the context menu.
If false, the context menu ignores mouse location.
Si es true, se permiten varios cursores. Al hacer clic izquierdo con Alt, se agrega un nuevo cursor. Véase add_caret() y get_caret_count().
Establece el tipo de cursor a dibujar.
Si es true, un clic con el botón derecho del ratón muestra el menú contextual.
String custom_word_separators = "" 🔗
The characters to consider as word delimiters if use_custom_word_separators is true. The characters should be defined without separation, for example #_!.
bool deselect_on_focus_loss_enabled = true 🔗
Si es true, el texto seleccionado se deseleccionará cuando se pierda el foco.
bool drag_and_drop_selection_enabled = true 🔗
If true, allow drag and drop of selected text. Text can still be dropped from other sources.
bool draw_control_chars = false 🔗
Si es true, se muestran los caracteres de control.
Si es true, el carácter "espacio" tendrá una representación visible.
Si es true, el carácter "tab" tendrá una representación visible.
Si es false, el texto existente no puede ser modificado y no se puede añadir un nuevo texto.
Si es true, el menú "Emojis y símbolos" está habilitado.
bool empty_selection_clipboard_enabled = true 🔗
Si es true, copiar o cortar sin una selección se realiza en todas las líneas con un cursor. De lo contrario, copiar y cortar requieren una selección.
bool highlight_all_occurrences = false 🔗
Si es true, se resaltarán todas las ocurrencias del texto seleccionado.
bool highlight_current_line = false 🔗
Si es true, se resalta la línea que contiene el cursor.
bool indent_wrapped_lines = false 🔗
Si es true, todas las líneas envueltas se indentan a la misma cantidad que la línea no envuelta.
Código de idioma utilizado para los algoritmos de salto de línea y forma del texto, si se deja vacío se utiliza la configuración regional actual.
bool middle_mouse_paste_enabled = true 🔗
Si es false, se deshabilitará el uso del botón central del ratón para pegar el contenido del portapapeles.
Nota: Este método solo está implementado en Linux.
If true, a minimap is shown, providing an outline of your source code. The minimap uses a fixed-width text size.
El ancho, en píxeles, del minimapa.
String placeholder_text = "" 🔗
Text shown when the TextEdit is empty. It is not the TextEdit's default value (see text).
bool scroll_fit_content_height = false 🔗
If true, TextEdit will disable vertical scroll and fit minimum height to the number of visible lines. When both this property and scroll_fit_content_width are true, no scrollbars will be displayed.
bool scroll_fit_content_width = false 🔗
If true, TextEdit will disable horizontal scroll and fit minimum width to the widest line in the text. When both this property and scroll_fit_content_height are true, no scrollbars will be displayed.
If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels.
bool scroll_past_end_of_file = false 🔗
Allow scrolling past the last line into "virtual" space.
Scroll smoothly over the text rather than jumping to the next location.
float scroll_v_scroll_speed = 80.0 🔗
Sets the scroll speed with the minimap or when scroll_smooth is enabled.
If there is a vertical scrollbar, this determines the current vertical scroll value in line numbers, starting at 0 for the top line.
bool selecting_enabled = true 🔗
Si es true, se puede seleccionar el texto.
Si es false, el texto no puede ser seleccionado por el usuario o por los métodos select() o select_all().
bool shortcut_keys_enabled = true 🔗
Si es true, las teclas de atajo para los elementos del menú contextual están habilitadas, incluso si el menú contextual está desactivado.
StructuredTextParser structured_text_bidi_override = 0 🔗
void set_structured_text_bidi_override(value: StructuredTextParser)
StructuredTextParser get_structured_text_bidi_override()
Establece la sobrescritura del algoritmo BiDi para el texto estructurado.
Array structured_text_bidi_override_options = [] 🔗
void set_structured_text_bidi_override_options(value: Array)
Array get_structured_text_bidi_override_options()
Establece opciones adicionales para la sobrescritura BiDi.
SyntaxHighlighter syntax_highlighter 🔗
void set_syntax_highlighter(value: SyntaxHighlighter)
SyntaxHighlighter get_syntax_highlighter()
The syntax highlighter to use.
Note: A SyntaxHighlighter instance should not be used across multiple TextEdit nodes.
If true, ProjectSettings.input/ui_text_indent input Tab character, otherwise it moves keyboard focus to the next Control in the scene.
Valor de string de TextEdit.
TextDirection text_direction = 0 🔗
void set_text_direction(value: TextDirection)
TextDirection get_text_direction()
Dirección base de escritura del texto.
bool use_custom_word_separators = false 🔗
If false, using Ctrl + Left or Ctrl + Right (Cmd + Left or Cmd + Right on macOS) bindings will use the behavior of use_default_word_separators. If true, it will also stop the caret if a character within custom_word_separators is detected. Useful for subword moving. This behavior also will be applied to the behavior of text selection.
bool use_default_word_separators = true 🔗
If false, using Ctrl + Left or Ctrl + Right (Cmd + Left or Cmd + Right on macOS) bindings will stop moving caret only if a space or punctuation is detected. If true, it will also stop the caret if a character is part of !"#$%&'()*+,-./:;<=>?@[\]^`{|}~, the Unicode General Punctuation table, or the Unicode CJK Punctuation table. Useful for subword moving. This behavior also will be applied to the behavior of text selection.
bool virtual_keyboard_enabled = true 🔗
Si es true, el teclado virtual nativo se habilitará en las plataformas que lo soporten.
bool virtual_keyboard_show_on_focus = true 🔗
Si es true, el teclado virtual nativo se mostrará en los eventos de foco en las plataformas que lo soporten.
LineWrappingMode wrap_mode = 0 🔗
void set_line_wrapping_mode(value: LineWrappingMode)
LineWrappingMode get_line_wrapping_mode()
Sets the line wrapping mode to use.
Descripciones de Métodos
void _backspace(caret_index: int) virtual 🔗
Sobrescribe este método para definir qué sucede cuando el usuario presiona la tecla de retroceso.
void _copy(caret_index: int) virtual 🔗
Sobrescribe este método para definir qué sucede cuando el usuario realiza una operación de copiado.
void _cut(caret_index: int) virtual 🔗
Sobrescribe este método para definir qué sucede cuando el usuario realiza una operación de corte.
void _handle_unicode_input(unicode_char: int, caret_index: int) virtual 🔗
Sobrescribe este método para definir qué sucede cuando el usuario introduce la tecla unicode_char proporcionada.
void _paste(caret_index: int) virtual 🔗
Sobrescribe este método para definir qué sucede cuando el usuario realiza una operación de pegado.
void _paste_primary_clipboard(caret_index: int) virtual 🔗
Sobrescribe este método para definir qué sucede cuando el usuario realiza una operación de pegado con el botón central del ratón.
Nota: Este método solo está implementado en Linux.
int add_caret(line: int, column: int) 🔗
Añade un nuevo cursor de texto en la ubicación dada. Devuelve el índice del nuevo cursor, o -1 si la ubicación no es válida.
void add_caret_at_carets(below: bool) 🔗
Añade un cursor de texto adicional por encima o por debajo de cada cursor. Si below es true, el nuevo cursor se añadirá debajo; de lo contrario, se añadirá por encima.
void add_gutter(at: int = -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.
void add_selection_for_next_occurrence() 🔗
Añade una selección y un cursor de texto para la siguiente ocurrencia de la selección actual. Si no hay ninguna selección activa, selecciona la palabra bajo el cursor de texto.
void adjust_carets_after_edit(caret: int, from_line: int, from_col: int, to_line: int, to_col: int) 🔗
Obsoleto: No longer necessary since methods now adjust carets themselves.
Este método no hace nada.
void adjust_viewport_to_caret(caret_index: int = 0) 🔗
Ajusta el viewport para que el cursor sea visible.
void apply_ime() 🔗
Aplica texto del Editor de métodos de entrada (IME) a cada cursor y cierra el IME si está abierto.
void backspace(caret_index: int = -1) 🔗
Se llama cuando el usuario pulsa la tecla de retroceso. Se puede sobrescribir con _backspace().
void begin_complex_operation() 🔗
Inicia una edición de varias partes. Todas las ediciones se tratarán como una única acción hasta que se llame a end_complex_operation().
void begin_multicaret_edit() 🔗
Inicia una edición para múltiples cursores. La edición debe finalizar con end_multicaret_edit(). Las ediciones con múltiples cursores se pueden usar para editar texto en varias posiciones a la vez y retrasar la fusión de los cursores hasta el final, para que los índices de los cursores no se vean afectados inmediatamente. begin_multicaret_edit() y end_multicaret_edit() se pueden anidar, y la fusión ocurrirá en el último end_multicaret_edit().
begin_complex_operation()
begin_multicaret_edit()
for i in range(get_caret_count()):
if multicaret_edit_ignore_caret(i):
continue
# Lógica aquí.
end_multicaret_edit()
end_complex_operation()
void cancel_ime() 🔗
Closes the Input Method Editor (IME) if it is open. Any text in the IME will be lost.
void center_viewport_to_caret(caret_index: int = 0) 🔗
Centra la vista en la línea en la que se encuentra el cursor de edición. Esto también restablece el valor de scroll_horizontal a 0.
void clear() 🔗
Realiza un reinicio completo de TextEdit, incluyendo el historial de deshacer.
void clear_undo_history() 🔗
Limpia el historial de deshacer.
void collapse_carets(from_line: int, from_column: int, to_line: int, to_column: int, inclusive: bool = false) 🔗
Colapsa todos los cursores en el rango dado a la posición de from_line y from_column.
inclusive se aplica a ambos extremos.
Si is_in_mulitcaret_edit() es true, los cursores que se colapsan serán true para multicaret_edit_ignore_caret().
Se llamará a merge_overlapping_carets() si se colapsó algún cursor.
void copy(caret_index: int = -1) 🔗
Copia la selección de texto actual. Puede ser sobreescrito con _copy().
void cut(caret_index: int = -1) 🔗
Corta la selección actual. Puede ser sobreescrito con _cut().
void delete_selection(caret_index: int = -1) 🔗
Elimina el texto seleccionado.
void deselect(caret_index: int = -1) 🔗
Deselecciona la selección actual.
void end_action() 🔗
Marca el final de los pasos en la acción actual iniciada con start_action().
void end_complex_operation() 🔗
Finaliza una edición multiparte, iniciada con begin_complex_operation(). Si se llama fuera de una operación compleja, la operación actual se empuja a la pila de deshacer/rehacer.
void end_multicaret_edit() 🔗
Finaliza una edición para múltiples cursores, que fue iniciada con begin_multicaret_edit(). Si esta fue la última llamada a end_multicaret_edit() y se llamó a merge_overlapping_carets(), los cursores se fusionarán.
int get_caret_column(caret_index: int = 0) const 🔗
Devuelve la columna en la que se encuentra el cursor de edición.
Devuelve el número de cursores en este TextEdit.
Vector2 get_caret_draw_pos(caret_index: int = 0) const 🔗
Devuelve la posición de dibujo del píxel del cursor.
PackedInt32Array get_caret_index_edit_order() 🔗
Obsoleto: Carets no longer need to be edited in any specific order. If the carets need to be sorted, use get_sorted_carets() instead.
Devuelve una lista de índices de cursores en su orden de edición, esto se hace de abajo hacia arriba. El orden de edición se refiere a la forma en que se aplican acciones como insert_text_at_caret().
int get_caret_line(caret_index: int = 0) const 🔗
Devuelve la línea en la que está el cursor de edición.
int get_caret_wrap_index(caret_index: int = 0) const 🔗
Devuelve el índice de ajuste en el que se encuentra el cursor de edición.
int get_first_non_whitespace_column(line: int) const 🔗
Devuelve la primera columna que contiene un carácter que no es un espacio en blanco en la línea dada. Si solo hay espacios en blanco, devuelve el número de caracteres.
int get_first_visible_line() const 🔗
Devuelve la primera línea visible.
int get_gutter_count() const 🔗
Returns the number of gutters registered.
String get_gutter_name(gutter: int) const 🔗
Returns the name of the gutter at the given index.
GutterType get_gutter_type(gutter: int) const 🔗
Returns the type of the gutter at the given index. Gutters can contain icons, text, or custom visuals.
int get_gutter_width(gutter: int) const 🔗
Returns the width of the gutter at the given index.
HScrollBar get_h_scroll_bar() const 🔗
Devuelve la HScrollBar utilizada por TextEdit.
int get_indent_level(line: int) const 🔗
Devuelve el nivel de sangría de la línea dada. Este es el número de espacios y tabulaciones al principio de la línea, teniendo en cuenta el tamaño de la tabulación (véase get_tab_size()).
int get_last_full_visible_line() const 🔗
Devuelve la última línea visible. Usa get_last_full_visible_line_wrap_index() para el índice de ajuste de línea.
int get_last_full_visible_line_wrap_index() const 🔗
Devuelve el último índice de ajuste de línea visible de la última línea visible.
Devuelve la última línea no oculta en todo el TextEdit.
String get_line(line: int) const 🔗
Devuelve el texto de una línea específica.
Color get_line_background_color(line: int) const 🔗
Devuelve el color de fondo personalizado de la línea dada. Si no se ha establecido ningún color, devuelve Color(0, 0, 0, 0).
Vector2i get_line_column_at_pos(position: Vector2i, clamp_line: bool = true, clamp_column: bool = true) const 🔗
Devuelve la línea y la columna en la posición dada. En el vector devuelto, x es la columna y y es la línea.
Si clamp_line es false y position está por debajo de la última línea, se devuelve Vector2i(-1, -1).
Si clamp_column es false y position está fuera del rango de columnas de la línea, se devuelve Vector2i(-1, -1).
Devuelve el número de líneas en el texto.
Texture2D get_line_gutter_icon(line: int, gutter: int) const 🔗
Returns the icon currently in gutter at line. This only works when the gutter type is GUTTER_TYPE_ICON (see set_gutter_type()).
Color get_line_gutter_item_color(line: int, gutter: int) const 🔗
Devuelve el color actualmente en gutter en la line.
Variant get_line_gutter_metadata(line: int, gutter: int) const 🔗
Devuelve los metadatos actualmente en gutter en la line.
String get_line_gutter_text(line: int, gutter: int) const 🔗
Devuelve el texto actualmente en gutter en la line. Esto solo funciona cuando el tipo de canal es GUTTER_TYPE_STRING (ver set_gutter_type()).
Devuelve el valor máximo de la altura de línea entre todas las líneas.
Nota: El valor devuelto está influenciado por line_spacing y font_size. Y no será menor que 1.
Array[Vector2i] get_line_ranges_from_carets(only_selections: bool = false, merge_adjacent: bool = true) const 🔗
Devuelve un Array de rangos de línea donde x es la primera línea y y es la última línea. Todas las líneas dentro de estos rangos tendrán un cursor sobre ellas o serán parte de una selección. Cada línea solo formará parte de un rango de línea, incluso si tiene múltiples cursores sobre ella.
Si la columna final de una selección (get_selection_to_column()) está en la columna 0, esa línea no será incluida. Si una selección comienza en la línea después de que otra selección termina y merge_adjacent es true, o si comienzan y terminan en la misma línea, un solo rango de línea incluirá ambas selecciones.
int get_line_width(line: int, wrap_index: int = -1) const 🔗
Devuelve el ancho en píxeles del wrap_index en la line.
String get_line_with_ime(line: int) const 🔗
Devuelve el texto de la línea tal como se muestra actualmente, incluida la string de composición IME.
int get_line_wrap_count(line: int) const 🔗
Devuelve el número de veces que la línea dada ha sido ajustada.
int get_line_wrap_index_at_column(line: int, column: int) const 🔗
Devuelve el índice de envoltura de la columna dada en la línea dada. Este va desde 0 hasta get_line_wrap_count().
PackedStringArray get_line_wrapped_text(line: int) const 🔗
Returns an array of Strings representing each wrapped index.
Vector2 get_local_mouse_pos() const 🔗
Devuelve la posición local del ratón ajustada a la dirección del texto.
Returns the PopupMenu of this TextEdit. By default, this menu is displayed when right-clicking on the TextEdit.
You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see MenuItems). For example:
func _ready():
var menu = get_menu()
# Remove all items after "Redo".
menu.item_count = menu.get_item_index(MENU_REDO) + 1
# Add custom items.
menu.add_separator()
menu.add_item("Insert Date", MENU_MAX + 1)
# Connect callback.
menu.id_pressed.connect(_on_item_pressed)
func _on_item_pressed(id):
if id == MENU_MAX + 1:
insert_text_at_caret(Time.get_date_string_from_system())
public override void _Ready()
{
var menu = GetMenu();
// Remove all items after "Redo".
menu.ItemCount = menu.GetItemIndex(TextEdit.MenuItems.Redo) + 1;
// Add custom items.
menu.AddSeparator();
menu.AddItem("Insert Date", TextEdit.MenuItems.Max + 1);
// Add event handler.
menu.IdPressed += OnItemPressed;
}
public void OnItemPressed(int id)
{
if (id == TextEdit.MenuItems.Max + 1)
{
InsertTextAtCaret(Time.GetDateStringFromSystem());
}
}
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 Window.visible property.
int get_minimap_line_at_pos(position: Vector2i) const 🔗
Devuelve la línea equivalente del minimapa en la position.
int get_minimap_visible_lines() const 🔗
Devuelve el número de líneas que se pueden dibujar en el minimapa.
int get_next_composite_character_column(line: int, column: int) const 🔗
Devuelve la columna correcta al final de un carácter compuesto como ❤️🩹 (corazón vendado; Unicode: U+2764 U+FE0F U+200D U+1FA79) que está compuesto por más de un punto de código Unicode, si el cursor está al inicio del carácter compuesto. También devuelve la columna correcta con el cursor en medio de un grafema y para caracteres no compuestos.
Nota: Para comprobar en la ubicación del cursor usa get_next_composite_character_column(get_caret_line(), get_caret_column())
Vector2i get_next_visible_line_index_offset_from(line: int, wrap_index: int, visible_amount: int) const 🔗
Similar a get_next_visible_line_offset_from(), pero tiene en cuenta los índices de envoltura de línea. En el vector devuelto, x es la línea, e y es el índice de envoltura.
int get_next_visible_line_offset_from(line: int, visible_amount: int) const 🔗
Devuelve el recuento hasta la siguiente línea visible desde line hasta line + visible_amount. También puede contar hacia atrás. Por ejemplo, si un TextEdit tiene 5 líneas con las líneas 2 y 3 ocultas, llamar a esto con line = 1, visible_amount = 1 devolvería 3.
Vector2i get_pos_at_line_column(line: int, column: int) const 🔗
Devuelve la posición local para la line (línea) y column (columna) dadas. Si x o y del vector devuelto son iguales a -1, la posición está fuera del área visible del control.
Nota: La posición Y corresponde a la parte inferior de la línea. Usa get_rect_at_line_column() para obtener la posición de la parte superior.
int get_previous_composite_character_column(line: int, column: int) const 🔗
Devuelve la columna correcta al inicio de un carácter compuesto como ❤️🩹 (corazón vendado; Unicode: U+2764 U+FE0F U+200D U+1FA79) que se compone de más de un punto de código Unicode, si el cursor está al final del carácter compuesto. También devuelve la columna correcta con el cursor en medio de un grafema y para caracteres no compuestos.
Nota: Para comprobar la ubicación del cursor, utiliza get_previous_composite_character_column(get_caret_line(), get_caret_column())
Rect2i get_rect_at_line_column(line: int, column: int) const 🔗
Devuelve la posición y el tamaño local para el grafema en la line (línea) y column (columna) dadas. Si la posición x o y del rectángulo devuelto es igual a -1, la posición está fuera del área visible del control.
Nota: La posición Y del rectángulo devuelto corresponde a la parte superior de la línea, a diferencia de get_pos_at_line_column() que devuelve la parte inferior.
int get_saved_version() const 🔗
Devuelve la última versión guardada etiquetada de tag_saved_version().
float get_scroll_pos_for_line(line: int, wrap_index: int = 0) const 🔗
Devuelve la posición de desplazamiento para wrap_index de line.
String get_selected_text(caret_index: int = -1) 🔗
Devuelve el texto dentro de la selección de un cursor, o de todos los cursores si caret_index es su valor por defecto -1.
int get_selection_at_line_column(line: int, column: int, include_edges: bool = true, only_selections: bool = true) const 🔗
Devuelve el índice del cursor de la selección en la line y column dadas, o -1 si no hay ninguna.
Si include_edges es false, la posición debe estar dentro de la selección y no en ninguno de los extremos. Si only_selections es false, también se considerarán los cursores sin selección.
int get_selection_column(caret_index: int = 0) const 🔗
Obsoleto: Use get_selection_origin_column() instead.
Devuelve la columna de inicio original de la selección.
int get_selection_from_column(caret_index: int = 0) const 🔗
Devuelve la columna de inicio de la selección. Devuelve la columna del cursor si no hay selección.
int get_selection_from_line(caret_index: int = 0) const 🔗
Devuelve la línea de inicio de la selección. Devuelve la línea del cursor si no hay selección.
int get_selection_line(caret_index: int = 0) const 🔗
Obsoleto: Use get_selection_origin_line() instead.
Devuelve la línea de inicio original de la selección.
SelectionMode get_selection_mode() const 🔗
Devuelve el modo de selección actual.
int get_selection_origin_column(caret_index: int = 0) const 🔗
Devuelve la columna de origen de la selección. Este es el extremo opuesto al cursor.
int get_selection_origin_line(caret_index: int = 0) const 🔗
Devuelve la línea de origen de la selección. Este es el extremo opuesto al cursor.
int get_selection_to_column(caret_index: int = 0) const 🔗
Devuelve la columna final de la selección. Devuelve la columna del cursor si no hay selección.
int get_selection_to_line(caret_index: int = 0) const 🔗
Devuelve la línea final de la selección. Devuelve la línea del cursor si no hay selección.
PackedInt32Array get_sorted_carets(include_ignored_carets: bool = false) const 🔗
Devuelve los cursores ordenados por selección comenzando desde la línea y columna más bajas hasta las más altas (de arriba a abajo del texto).
Si include_ignored_carets es false, se ignorarán los cursores de multicaret_edit_ignore_caret().
Devuelve el tamaño de la pestaña de TextEdit.
int get_total_gutter_width() const 🔗
Returns the total width of all gutters and internal padding.
int get_total_visible_line_count() const 🔗
Devuelve el número total de líneas en el texto. Esto incluye las líneas ajustadas y excluye las líneas plegadas. Si wrap_mode está establecido en LINE_WRAPPING_NONE y no hay líneas plegadas (ver CodeEdit.is_line_folded()), entonces es equivalente a get_line_count(). Véase get_visible_line_count_in_range() para un rango limitado de líneas.
VScrollBar get_v_scroll_bar() const 🔗
Devuelve la VScrollBar del TextEdit.
Devuelve la versión actual del TextEdit. La versión es un recuento de las operaciones registradas por el historial de deshacer/rehacer.
int get_visible_line_count() const 🔗
Devuelve el número de líneas que pueden caber visualmente, redondeado hacia abajo, basándose en la altura de este control.
int get_visible_line_count_in_range(from_line: int, to_line: int) const 🔗
Devuelve el número total de líneas entre from_line y to_line (inclusive) en el texto. Esto incluye las líneas ajustadas y excluye las líneas plegadas. Si el rango cubre todas las líneas, es equivalente a get_total_visible_line_count().
String get_word_at_pos(position: Vector2) const 🔗
Devuelve la palabra en position.
String get_word_under_caret(caret_index: int = -1) const 🔗
Devuelve un String con la palabra debajo la ubicación del cursor.
Devuelve true si el usuario tiene texto en el Editor de métodos de entrada (IME).
Devuelve true si una acción de "redo" está disponible.
bool has_selection(caret_index: int = -1) const 🔗
Devuelve true si el usuario ha seleccionado texto.
Devuelve true si se dispone de una acción de "deshacer".
void insert_line_at(line: int, text: String) 🔗
Inserta una nueva línea con text en la line.
void insert_text(text: String, line: int, column: int, before_selection_begin: bool = true, before_selection_end: bool = false) 🔗
Inserta el text en la line y la column.
Si before_selection_begin es true, los cursores y selecciones que comienzan en la line y la column se moverán al final del texto insertado, junto con todos los cursores posteriores.
Si before_selection_end es true, las selecciones que terminan en la line y la column se extenderán hasta el final del texto insertado. Estos parámetros se pueden usar para insertar texto dentro o fuera de las selecciones.
void insert_text_at_caret(text: String, caret_index: int = -1) 🔗
Inserta el texto especificado en la posición del cursor.
bool is_caret_after_selection_origin(caret_index: int = 0) const 🔗
Devuelve true si el cursor de la selección está después del origen de la selección. Esto se puede utilizar para determinar la dirección de la selección.
bool is_caret_visible(caret_index: int = 0) const 🔗
Devuelve true si el cursor es visible, de lo contrario false. Un cursor se considerará oculto si está fuera del área desplazable cuando el desplazamiento está activado.
Nota: is_caret_visible() no tiene en cuenta que un cursor esté fuera de la pantalla si todavía está dentro del área desplazable. Devolverá true incluso si el cursor está fuera de la pantalla siempre que cumpla con las propias condiciones de TextEdit para ser visible. Esto incluye los usos de scroll_fit_content_width y scroll_fit_content_height que hacen que el TextEdit se expanda más allá de los límites de la ventana gráfica.
bool is_dragging_cursor() const 🔗
Devuelve true si el usuario está arrastrando el ratón para desplazarse, seleccionar o arrastrar texto.
bool is_gutter_clickable(gutter: int) const 🔗
Returns true if the gutter at the given index is clickable. See set_gutter_clickable().
bool is_gutter_drawn(gutter: int) const 🔗
Returns true if the gutter at the given index is currently drawn. See set_gutter_draw().
bool is_gutter_overwritable(gutter: int) const 🔗
Returns true if the gutter at the given index is overwritable. See set_gutter_overwritable().
bool is_in_mulitcaret_edit() const 🔗
Devuelve true si se ha llamado a begin_multicaret_edit() y aún no se ha llamado a end_multicaret_edit().
bool is_line_gutter_clickable(line: int, gutter: int) const 🔗
Returns true if the gutter at the given index on the given line is clickable. See set_line_gutter_clickable().
bool is_line_wrapped(line: int) const 🔗
Devuelve si la línea dada está ajustada.
Devuelve true si el menú es visible. Usa esto en lugar de get_menu().visible para mejorar el rendimiento (así se evita la creación del menú). Véase get_menu().
bool is_mouse_over_selection(edges: bool, caret_index: int = -1) const 🔗
Devuelve true si el ratón está sobre una selección. Si edges es true, los bordes se consideran parte de la selección.
bool is_overtype_mode_enabled() const 🔗
Devuelve true si el modo de sobrescritura está activado. Véase set_overtype_mode_enabled().
Ejecuta una acción determinada según se define en el enum MenuItems.
void merge_gutters(from_line: int, to_line: int) 🔗
Fusiona las canaletas de la línea from_line en la línea to_line. Solo se copiarán las canaletas sobrescribibles. Véase set_gutter_overwritable().
void merge_overlapping_carets() 🔗
Fusiona los cursores que se solapen. Se dará prioridad al cursor más nuevo o al cursor con una selección.
Si is_in_mulitcaret_edit() es true, la fusión se pondrá en cola para que se produzca al final de la edición multcursor. Véase begin_multicaret_edit() y end_multicaret_edit().
Nota: Esto no se llama cuando un cursor cambia de posición, sino después de ciertas acciones, por lo que es posible entrar en un estado en el que los cursores se solapan.
bool multicaret_edit_ignore_caret(caret_index: int) const 🔗
Devuelve true si el caret_index dado debe ser ignorado como parte de una edición multcursor. Véase begin_multicaret_edit() y end_multicaret_edit(). Los cursores que deben ser ignorados son aquellos que formaban parte de texto eliminado y que probablemente se fusionarán al final de la edición, o los cursores que se añadieron durante la edición.
Se recomienda usar continue dentro de un bucle que itere sobre múltiples cursores si un cursor debe ser ignorado.
void paste(caret_index: int = -1) 🔗
Pega en la ubicación actual. Puede ser sobreescrito con _paste().
void paste_primary_clipboard(caret_index: int = -1) 🔗
Pega el portapapeles principal.
void redo() 🔗
Realiza la operación de rehacer.
void remove_caret(caret: int) 🔗
Elimina el índice del cursor indicado.
Nota: Esto puede provocar el ajuste de todos los demás índices de cursor.
void remove_gutter(gutter: int) 🔗
Removes the gutter at the given index.
void remove_line_at(line: int, move_carets_down: bool = true) 🔗
Elimina la línea de texto en line. Los cursores en esta línea intentarán coincidir con su posición x visual anterior.
Si move_carets_down es true, los cursores se moverán a la siguiente línea hacia abajo, de lo contrario, los cursores se moverán hacia arriba.
void remove_secondary_carets() 🔗
Elimina todos los cursores adicionales.
void remove_text(from_line: int, from_column: int, to_line: int, to_column: int) 🔗
Elimina el texto entre las posiciones dadas.
Vector2i search(text: String, flags: int, from_line: int, from_column: int) const 🔗
Perform a search inside the text. Search flags can be specified in the SearchFlags enum.
In the returned vector, x is the column, y is the line. If no results are found, both are equal to -1.
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
Vector2I result = Search("print", (uint)TextEdit.SearchFlags.WholeWords, 0, 0);
if (result.X != -1)
{
// Result found.
int lineNumber = result.Y;
int columnNumber = result.X;
}
void select(origin_line: int, origin_column: int, caret_line: int, caret_column: int, caret_index: int = 0) 🔗
Selects text from origin_line and origin_column to caret_line and caret_column for the given caret_index. This moves the selection origin and the caret. If the positions are the same, the selection will be deselected.
If selecting_enabled is false, no selection will occur.
Note: If supporting multiple carets this will not check for any overlap. See merge_overlapping_carets().
void select_all() 🔗
Selecciona todo el texto.
Si selecting_enabled es false, no se producirá ninguna selección.
void select_word_under_caret(caret_index: int = -1) 🔗
Selecciona la palabra debajo del cursor.
void set_caret_column(column: int, adjust_viewport: bool = true, caret_index: int = 0) 🔗
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.
Note: If supporting multiple carets this will not check for any overlap. See merge_overlapping_carets().
void set_caret_line(line: int, adjust_viewport: bool = true, can_be_hidden: bool = true, wrap_index: int = 0, caret_index: int = 0) 🔗
Moves the caret to the specified line index. The caret column will be moved to the same visual position it was at the last time set_caret_column() was called, or clamped to the end of the line.
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.
If wrap_index is -1, the caret column will be clamped to the line's length. If wrap_index is greater than -1, the column will be moved to attempt to match the visual x position on the line's wrap_index to the position from the last time set_caret_column() was called.
Note: If supporting multiple carets this will not check for any overlap. See merge_overlapping_carets().
void set_gutter_clickable(gutter: int, clickable: bool) 🔗
If true, the mouse cursor will change to a pointing hand (Control.CURSOR_POINTING_HAND) when hovering over the gutter at the given index. See is_gutter_clickable() and set_line_gutter_clickable().
void set_gutter_custom_draw(column: int, draw_callback: Callable) 🔗
Set a custom draw callback for the gutter at the given index. draw_callback must take the following arguments: A line index int, a gutter index int, and an area Rect2. This callback only works when the gutter type is GUTTER_TYPE_CUSTOM (see set_gutter_type()).
void set_gutter_draw(gutter: int, draw: bool) 🔗
If true, the gutter at the given index is drawn. The gutter type (set_gutter_type()) determines how it is drawn. See is_gutter_drawn().
void set_gutter_name(gutter: int, name: String) 🔗
Sets the name of the gutter at the given index.
void set_gutter_overwritable(gutter: int, overwritable: bool) 🔗
If true, the line data of the gutter at the given index can be overridden when using merge_gutters(). See is_gutter_overwritable().
void set_gutter_type(gutter: int, type: GutterType) 🔗
Sets the type of gutter at the given index. Gutters can contain icons, text, or custom visuals.
void set_gutter_width(gutter: int, width: int) 🔗
Set the width of the gutter at the given index.
void set_line(line: int, new_text: String) 🔗
Sets the text for a specific line.
Carets on the line will attempt to keep their visual x position.
void set_line_as_center_visible(line: int, wrap_index: int = 0) 🔗
Positions the wrap_index of line at the center of the viewport.
void set_line_as_first_visible(line: int, wrap_index: int = 0) 🔗
Positions the wrap_index of line at the top of the viewport.
void set_line_as_last_visible(line: int, wrap_index: int = 0) 🔗
Positions the wrap_index of line at the bottom of the viewport.
void set_line_background_color(line: int, color: Color) 🔗
Sets the custom background color of the given line. If transparent, this color is applied on top of the default background color (See background_color). If set to Color(0, 0, 0, 0), no additional color is applied.
void set_line_gutter_clickable(line: int, gutter: int, clickable: bool) 🔗
If clickable is true, makes the gutter on the given line clickable. This is like set_gutter_clickable(), but for a single line. If is_gutter_clickable() is true, this will not have any effect. See is_line_gutter_clickable() and gutter_clicked.
void set_line_gutter_icon(line: int, gutter: int, icon: Texture2D) 🔗
Sets the icon for gutter on line to icon. This only works when the gutter type is GUTTER_TYPE_ICON (see set_gutter_type()).
void set_line_gutter_item_color(line: int, gutter: int, color: Color) 🔗
Sets the color for gutter on line to color.
void set_line_gutter_metadata(line: int, gutter: int, metadata: Variant) 🔗
Sets the metadata for gutter on line to metadata.
void set_line_gutter_text(line: int, gutter: int, text: String) 🔗
Sets the text for gutter on line to text. This only works when the gutter type is GUTTER_TYPE_STRING (see set_gutter_type()).
void set_overtype_mode_enabled(enabled: bool) 🔗
If true, enables overtype mode. In this mode, typing overrides existing text instead of inserting text. The ProjectSettings.input/ui_text_toggle_insert_mode action toggles overtype mode. See is_overtype_mode_enabled().
void set_search_flags(flags: int) 🔗
Sets the search flags. This is used with set_search_text() to highlight occurrences of the searched text. Search flags can be specified from the SearchFlags enum.
void set_search_text(search_text: String) 🔗
Sets the search text. See set_search_flags().
void set_selection_mode(mode: SelectionMode) 🔗
Sets the current selection mode.
void set_selection_origin_column(column: int, caret_index: int = 0) 🔗
Sets the selection origin column to the column for the given caret_index. If the selection origin is moved to the caret position, the selection will deselect.
void set_selection_origin_line(line: int, can_be_hidden: bool = true, wrap_index: int = -1, caret_index: int = 0) 🔗
Sets the selection origin line to the line for the given caret_index. If the selection origin is moved to the caret position, the selection will deselect.
If can_be_hidden is false, The line will be set to the nearest unhidden line below or above.
If wrap_index is -1, the selection origin column will be clamped to the line's length. If wrap_index is greater than -1, the column will be moved to attempt to match the visual x position on the line's wrap_index to the position from the last time set_selection_origin_column() or select() was called.
void set_tab_size(size: int) 🔗
Sets the tab size for the TextEdit to use.
void set_tooltip_request_func(callback: Callable) 🔗
Provide custom tooltip text. The callback method must take the following args: hovered_word: String.
void skip_selection_for_next_occurrence() 🔗
Moves a selection and a caret for the next occurrence of the current selection. If there is no active selection, moves to the next occurrence of the word under caret.
void start_action(action: EditAction) 🔗
Starts an action, will end the current action if action is different.
An action will also end after a call to end_action(), after ProjectSettings.gui/timers/text_edit_idle_detect_sec is triggered or a new undoable step outside the start_action() and end_action() calls.
void swap_lines(from_line: int, to_line: int) 🔗
Intercambia las dos líneas. Los cursores se intercambiarán con las líneas.
void tag_saved_version() 🔗
Tag the current version as saved.
void undo() 🔗
Realiza la operación de deshacer.
Descripciones de las propiedades del tema
Color background_color = Color(0, 0, 0, 0) 🔗
Establece el Color del fondo de este TextEdit.
Color caret_background_color = Color(0, 0, 0, 1) 🔗
El Color del texto detrás del cursor cuando se utiliza un cursor de bloque.
Color caret_color = Color(0.875, 0.875, 0.875, 1) 🔗
El Color del cursor. Se puede configurar en un color totalmente transparente para ocultarlo por completo.
Color current_line_color = Color(0.25, 0.25, 0.26, 0.8) 🔗
El Color del fondo de la línea que contiene el cursor.
Color font_color = Color(0.875, 0.875, 0.875, 1) 🔗
Establece la fuente Color.
Color font_outline_color = Color(0, 0, 0, 1) 🔗
El tono del contorno del texto de TextEdit.
Color font_placeholder_color = Color(0.875, 0.875, 0.875, 0.6) 🔗
Color de fuente para placeholder_text.
Color font_readonly_color = Color(0.875, 0.875, 0.875, 0.5) 🔗
Establece el Color de la fuente cuando editable está deshabilitado.
Color font_selected_color = Color(0, 0, 0, 0) 🔗
Sets the Color of the selected text. If equal to Color(0, 0, 0, 0), it will be ignored.
Color search_result_border_color = Color(0.3, 0.3, 0.3, 0.4) 🔗
Color del borde alrededor del texto que coincide con la consulta de búsqueda.
Color search_result_color = Color(0.3, 0.3, 0.3, 1) 🔗
Color detrás del texto que coincide con la consulta de búsqueda.
Color selection_color = Color(0.5, 0.5, 0.5, 1) 🔗
Establece el resaltado Color de las selecciones de texto.
Color word_highlighted_color = Color(0.5, 0.5, 0.5, 0.25) 🔗
Establece el resaltado Color de múltiples ocurrencias. highlight_all_occurrences tiene que ser activado.
El ancho del cursor en píxeles. Se pueden usar valores mayores para mejorar la accesibilidad, asegurando que el cursor sea fácilmente visible, o para asegurar la consistencia con un tamaño de fuente grande. Si se establece en 0 o menos, el ancho del cursor se establece automáticamente en 1 píxel y se multiplica por el factor de escala de la pantalla.
Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
The size of the text outline.
Note: If using a font with FontFile.multichannel_signed_distance_field enabled, its FontFile.msdf_pixel_range must be set to at least twice the value of outline_size for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
Establece la Font predeterminada.
Establece el tamaño de fuente predeterminado.
Establece una Texture2D personalizada para los caracteres de espacio.
Establece una Texture2D personalizada para los caracteres de tabulación.
Establece el StyleBox cuando está en foco. El focus StyleBox se muestra sobre el StyleBox base, por lo que se debe utilizar un StyleBox parcialmente transparente para garantizar que el StyleBox base permanezca visible. Un StyleBox que representa un contorno o un subrayado funciona bien para este propósito. Para deshabilitar el efecto visual de enfoque, asigna un recurso StyleBoxEmpty. Ten en cuenta que deshabilitar el efecto visual de enfoque perjudicará la usabilidad de la navegación con el teclado/mando, por lo que no se recomienda por razones de accesibilidad.
Establece el StyleBox de este TextEdit.
Establece el StyleBox de este TextEdit cuando editable está deshabilitado.