Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
TextEdit
Hérite de : Control < CanvasItem < Node < Object
Hérité par : CodeEdit
Un éditeur de texte multi-ligne.
Description
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.
Propriétés
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
focus_mode |
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
mouse_default_cursor_shape |
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Méthodes
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_in_viewport(line: 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() |
Propriétés du thème
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Signaux
caret_changed() 🔗
Emitted when any caret changes position.
gutter_added() 🔗
Émis lorsqu'un bandeau est ajouté.
gutter_clicked(line: int, gutter: int) 🔗
Émis lorsqu'un bandeau est cliqué.
gutter_removed() 🔗
Émis lorsqu'un bandeau est supprimé.
lines_edited_from(from_line: int, to_line: int) 🔗
Émis immédiatement lorsque le texte change.
Lorsque le texte est ajouté, from_line sera inférieur à to_line. Sur une suppression, to_line sera inférieur à from_line.
text_changed() 🔗
Émis lorsque le texte change.
text_set() 🔗
Énumérations
Coupe (copie puis efface) le texte sélectionné.
Copie le texte sélectionné.
Colle le texte dans le presse-papiers sur le texte sélectionné (ou à la position du curseur).
Efface l’ensemble du texte TextEdit.
Sélectionne l'ensemble du texte TextEdit.
Annule l’action précédente.
Refait l’action précédente.
ID du sous-menu "Direction d'écriture du texte".
Definit la direction du texte à "hérité".
Définit la direction du texte à "automatique".
Définit la direction du texte à "gauche à droite".
Définit la direction du texte à "droite à gauche".
Active/désactive l'affichage des caractères de contrôle.
ID du sous-menu "Insérer caractère de contrôle".
Insère un caractère marque gauche-à-droite (Left-to-Right Mark).
Insère un caractère marque droite-à-gauche (Right-to-Left Mark).
Insère un caractère enchâssement gauche-à-droite (Left-to-Right Embedding).
Insère un caractère enchâssement droite-à-gauche (Right-to-Left Embedding).
Insère un caractère forçage gauche-à-droite (Left-to-Right Override).
Insère un caractère forçage droite-à-gauche (Right-to-Left Override).
Insère un caractère dépilement de formatage conditionnel (Pop Direction Formatting).
Insère un caractère marque de lettre arabe (Arabic Letter Mark).
Insère un caractère isolat de gauche-à-droite (Left-to-Right Isolate).
Insère un caractère isolat de droite-à-gauche (Right-to-Left Isolate).
Insère un caractère isolat à direction indéterminée (First Strong Isolate).
Insère un caractère dépilement d'isolat directionnel (Pop Direction Isolate).
Ajoute un caractère liant sans chasse (Zero Width Joiner).
Insère un caractère antiliant sans chasse (Zero Width Non-Joiner).
Insère un caractère gluon de mots (Word Joiner).
Insère un caractère trait d’union conditionnel (Soft HYphen).
Ouvre le sélecteur d'émojis et de symboles du système.
Représente la taille de l'énumération MenuItems.
enum EditAction: 🔗
EditAction ACTION_NONE = 0
Pas d'action actuelle.
EditAction ACTION_TYPING = 1
Action de saisie.
EditAction ACTION_BACKSPACE = 2
A backwards delete action.
EditAction ACTION_DELETE = 3
A forward delete action.
enum SearchFlags: 🔗
SearchFlags SEARCH_MATCH_CASE = 1
Respecte la casse lors de la recherche.
SearchFlags SEARCH_WHOLE_WORDS = 2
Faites correspondre des mots entiers lors de la recherche.
SearchFlags SEARCH_BACKWARDS = 4
Recherche de la fin au début.
enum CaretType: 🔗
CaretType CARET_TYPE_LINE = 0
Vertical line caret.
CaretType CARET_TYPE_BLOCK = 1
Bloc curseur.
enum SelectionMode: 🔗
SelectionMode SELECTION_MODE_NONE = 0
Aucune sélection.
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
Line wrapping is disabled.
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.
Descriptions des propriétés
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 true et caret_mid_grapheme vaut false, le retour arrière supprime un caractère composite tel que ❤️🩹 en entier, au lieu de ne supprimer qu'une partie du caractère composite.
Si true, fait clignoter le curseur.
float caret_blink_interval = 0.65 🔗
L'intervalle auquel le curseur clignote (en secondes).
bool caret_draw_when_editable_disabled = false 🔗
void set_draw_caret_when_editable_disabled(value: bool)
bool is_drawing_caret_when_editable_disabled()
If true, caret will be visible when editable is disabled.
bool caret_mid_grapheme = false 🔗
Permet de déplacer le curseur, de sélectionner et de supprimer les composantes individuelles de caractères composites.
Note : Retour arrière supprime toujours les composantes individuelles de caractères composites.
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.
If true, multiple carets are allowed. Left-clicking with Alt adds a new caret. See add_caret() and get_caret_count().
Définit le type de curseur à dessiner.
Si true, un clic droit affiche le menu contextuel.
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 true, le texte actuellement sélectionné sera désélectionné quand le focus sera perdu.
bool drag_and_drop_selection_enabled = true 🔗
Si true, permet le glissé-déposé du texte sélectionné. Le texte peut toujours être déposé depuis d'autres sources.
bool draw_control_chars = false 🔗
Si true, les caractères de contrôle sont affichés.
Si true, le caractère espace " " sera affiché.
Si true, le caractère de tabulation sera affiché.
Si false, le texte existant ne peut être modifié et du nouveau texte ne peut être ajouté.
Si true, le menu "Émojis et Symboles" est activé.
bool empty_selection_clipboard_enabled = true 🔗
If true, copying or cutting without a selection is performed on all lines with a caret. Otherwise, copy and cut require a selection.
bool highlight_all_occurrences = false 🔗
Si true, toutes les occurrences du texte sélectionné sont surlignées.
bool highlight_current_line = false 🔗
Si true, la ligne contenant le curseur de texte est surlignée.
bool indent_wrapped_lines = false 🔗
If true, all wrapped lines are indented to the same amount as the unwrapped line.
Code de langue utilisé pour les algorithmes de retour à la ligne et de "text shaping". Si laissé vide, la langue actuelle est utilisée à la place.
bool middle_mouse_paste_enabled = true 🔗
Si false, utiliser le bouton du milieu de la souris pour coller le presse-papiers sera désactivé.
Note : Cette méthode n'est implémentée que sur Linux.
If true, a minimap is shown, providing an outline of your source code. The minimap uses a fixed-width text size.
La largeur, en pixels, de la mini-carte.
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 fits its minimum height to the number of visible lines instead of scrolling vertically. If a maximum height is set (for example via Control.custom_maximum_size) and content exceeds it, a vertical scrollbar is shown.
bool scroll_fit_content_width = false 🔗
If true, TextEdit fits its minimum width to the widest line instead of scrolling horizontally. If a maximum width is set (for example via Control.custom_maximum_size) and content exceeds it, a horizontal scrollbar is shown.
S'il y a une barre de défilement horizontale, cela détermine le décalage de défilement horizontal actuel en 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.
S'il y a une barre de défilement verticale, cela détermine le décalage de défilement vertical actuel en nombres de lignes, en commençant par 0 pour la ligne du haut.
bool selecting_enabled = true 🔗
Si true, le texte peut être sélectionné.
Si false, le texte ne peut pas être sélectionné par l'utilisateur ou par les méthodes select() ou select_all().
bool shortcut_keys_enabled = true 🔗
Si true, les touches de raccourci pour les éléments de menu contextuel sont activées, même si le menu contextuel est désactivé.
StructuredTextParser structured_text_bidi_override = 0 🔗
void set_structured_text_bidi_override(value: StructuredTextParser)
StructuredTextParser get_structured_text_bidi_override()
Définit la redéfinition de l'algorithme BiDi pour le texte structuré.
Array structured_text_bidi_override_options = [] 🔗
void set_structured_text_bidi_override_options(value: Array)
Array get_structured_text_bidi_override_options()
Définit des options supplémentaires pour la redéfinition 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.
Valeur de la chaîne de caractères du TextEdit.
TextDirection text_direction = 0 🔗
void set_text_direction(value: TextDirection)
TextDirection get_text_direction()
Direction d'écriture du texte de base.
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 true, le clavier virtuel natif est activé sur les plateformes qui le supportent.
bool virtual_keyboard_show_on_focus = true 🔗
Si true, le clavier virtuel natif est affiché lors des évènements de focus sur les plateformes qui le supportent.
LineWrappingMode wrap_mode = 0 🔗
void set_line_wrapping_mode(value: LineWrappingMode)
LineWrappingMode get_line_wrapping_mode()
Sets the line wrapping mode to use.
Descriptions des méthodes
void _backspace(caret_index: int) virtual 🔗
Override this method to define what happens when the user presses the backspace key.
void _copy(caret_index: int) virtual 🔗
Redéfinissez cette méthode pour définir ce qui se passe quand l'utilisateur effectue une opération de copie.
void _cut(caret_index: int) virtual 🔗
Redéfinissez cette méthode pour définir ce qui se passe quand l'utilisateur effectue une opération de coupe.
void _handle_unicode_input(unicode_char: int, caret_index: int) virtual 🔗
Override this method to define what happens when the user types in the provided key unicode_char.
void _paste(caret_index: int) virtual 🔗
Redéfinissez cette méthode pour définir ce qui se passe quand l'utilisateur effectue une opération de collage.
void _paste_primary_clipboard(caret_index: int) 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.
int add_caret(line: int, column: int) 🔗
Adds a new caret at the given location. Returns the index of the new caret, or -1 if the location is invalid.
void add_caret_at_carets(below: bool) 🔗
Adds an additional caret above or below every caret. If below is true the new caret will be added below and above otherwise.
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() 🔗
Adds a selection and a caret for the next occurrence of the current selection. If there is no active selection, selects word under caret.
void adjust_carets_after_edit(caret: int, from_line: int, from_col: int, to_line: int, to_col: int) 🔗
Obsolète : No longer necessary since methods now adjust carets themselves.
Cette méthode ne fait rien.
void adjust_viewport_to_caret(caret_index: int = 0) 🔗
Adjust the viewport so the caret is visible.
void apply_ime() 🔗
Applies text from the Input Method Editor (IME) to each caret and closes the IME if it is open.
void backspace(caret_index: int = -1) 🔗
Called when the user presses the backspace key. Can be overridden with _backspace().
void begin_complex_operation() 🔗
Starts a multipart edit. All edits will be treated as one action until end_complex_operation() is called.
void begin_multicaret_edit() 🔗
Starts an edit for multiple carets. The edit must be ended with end_multicaret_edit(). Multicaret edits can be used to edit text at multiple carets and delay merging the carets until the end, so the caret indexes aren't affected immediately. begin_multicaret_edit() and end_multicaret_edit() can be nested, and the merge will happen at the last end_multicaret_edit().
begin_complex_operation()
begin_multicaret_edit()
for i in range(get_caret_count()):
if multicaret_edit_ignore_caret(i):
continue
# Logic here.
end_multicaret_edit()
end_complex_operation()
void cancel_ime() 🔗
Ferme l'éditeur de méthode de saisie (Input Method Editor) s'il est ouvert. Tout texte dans l'IME sera perdu.
void center_viewport_to_caret(caret_index: int = 0) 🔗
Centers the viewport on the line the editing caret is at. This also resets the scroll_horizontal value to 0.
void clear() 🔗
Performs a full reset of TextEdit, including undo history.
void clear_undo_history() 🔗
Efface l'historique des annulations.
void collapse_carets(from_line: int, from_column: int, to_line: int, to_column: int, inclusive: bool = false) 🔗
Collapse all carets in the given range to the from_line and from_column position.
inclusive applies to both ends.
If is_in_mulitcaret_edit() is true, carets that are collapsed will be true for multicaret_edit_ignore_caret().
merge_overlapping_carets() will be called if any carets were collapsed.
void copy(caret_index: int = -1) 🔗
Copies the current text selection. Can be overridden with _copy().
void cut(caret_index: int = -1) 🔗
Cut's the current selection. Can be overridden with _cut().
void delete_selection(caret_index: int = -1) 🔗
Supprime le texte sélectionné.
void deselect(caret_index: int = -1) 🔗
Désélectionne la sélection actuelle.
void end_action() 🔗
Marks the end of steps in the current action started with start_action().
void end_complex_operation() 🔗
Ends a multipart edit, started with begin_complex_operation(). If called outside a complex operation, the current operation is pushed onto the undo/redo stack.
void end_multicaret_edit() 🔗
Ends an edit for multiple carets, that was started with begin_multicaret_edit(). If this was the last end_multicaret_edit() and merge_overlapping_carets() was called, carets will be merged.
int get_caret_column(caret_index: int = 0) const 🔗
Returns the column the editing caret is at.
Returns the number of carets in this TextEdit.
Vector2 get_caret_draw_pos(caret_index: int = 0) const 🔗
Returns the caret pixel draw position.
PackedInt32Array get_caret_index_edit_order() 🔗
Obsolète : Carets no longer need to be edited in any specific order. If the carets need to be sorted, use get_sorted_carets() instead.
Returns a list of caret indexes in their edit order, this done from bottom to top. Edit order refers to the way actions such as insert_text_at_caret() are applied.
int get_caret_line(caret_index: int = 0) const 🔗
Returns the line the editing caret is on.
int get_caret_wrap_index(caret_index: int = 0) const 🔗
Returns the wrap index the editing caret is on.
int get_first_non_whitespace_column(line: int) const 🔗
Returns the first column containing a non-whitespace character on the given line. If there is only whitespace, returns the number of characters.
int get_first_visible_line() const 🔗
Renvoie la première ligne 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 🔗
Returns the HScrollBar used by TextEdit.
int get_indent_level(line: int) const 🔗
Returns the indent level of the given line. This is the number of spaces and tabs at the beginning of the line, with the tabs taking the tab size into account (see get_tab_size()).
int get_last_full_visible_line() const 🔗
Returns the last visible line. Use get_last_full_visible_line_wrap_index() for the wrap index.
int get_last_full_visible_line_wrap_index() const 🔗
Returns the last visible wrap index of the last visible line.
Returns the last unhidden line in the entire TextEdit.
String get_line(line: int) const 🔗
Renvoie le texte pour la ligne renseignée.
Color get_line_background_color(line: int) const 🔗
Returns the custom background color of the given line. If no color is set, returns Color(0, 0, 0, 0).
Vector2i get_line_column_at_pos(position: Vector2i, clamp_line: bool = true, clamp_column: bool = true) const 🔗
Returns the line and column at the given position. In the returned vector, x is the column and y is the line.
If clamp_line is false and position is below the last line, Vector2i(-1, -1) is returned.
If clamp_column is false and position is outside the column range of the line, Vector2i(-1, -1) is returned.
Returns the number of lines in the text.
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 🔗
Returns the color currently in gutter at line.
Variant get_line_gutter_metadata(line: int, gutter: int) const 🔗
Returns the metadata currently in gutter at line.
String get_line_gutter_text(line: int, gutter: int) const 🔗
Returns the text currently in gutter at line. This only works when the gutter type is GUTTER_TYPE_STRING (see set_gutter_type()).
Returns the maximum value of the line height among all lines.
Note: The return value is influenced by line_spacing and font_size. And it will not be less than 1.
Array[Vector2i] get_line_ranges_from_carets(only_selections: bool = false, merge_adjacent: bool = true) const 🔗
Returns an Array of line ranges where x is the first line and y is the last line. All lines within these ranges will have a caret on them or be part of a selection. Each line will only be part of one line range, even if it has multiple carets on it.
If a selection's end column (get_selection_to_column()) is at column 0, that line will not be included. If a selection begins on the line after another selection ends and merge_adjacent is true, or they begin and end on the same line, one line range will include both selections.
int get_line_width(line: int, wrap_index: int = -1) const 🔗
Returns the width in pixels of the wrap_index on line.
String get_line_with_ime(line: int) const 🔗
Returns line text as it is currently displayed, including IME composition string.
int get_line_wrap_count(line: int) const 🔗
Returns the number of times the given line is wrapped.
int get_line_wrap_index_at_column(line: int, column: int) const 🔗
Returns the wrap index of the given column on the given line. This ranges from 0 to 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 🔗
Returns the local mouse position adjusted for the text direction.
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 🔗
Returns the equivalent minimap line at position.
int get_minimap_visible_lines() const 🔗
Returns the number of lines that may be drawn on the minimap.
int get_next_composite_character_column(line: int, column: int) const 🔗
Returns the correct column at the end of a composite character like ❤️🩹 (mending heart; Unicode: U+2764 U+FE0F U+200D U+1FA79) which is comprised of more than one Unicode code point, if the caret is at the start of the composite character. Also returns the correct column with the caret at mid grapheme and for non-composite characters.
Note: To check at caret location use 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 to 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.
int get_next_visible_line_offset_from(line: int, visible_amount: int) 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.
Vector2i get_pos_at_line_column(line: int, column: int) 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 get_rect_at_line_column() to get the top side position.
int get_previous_composite_character_column(line: int, column: int) const 🔗
Returns the correct column at the start of a composite character like ❤️🩹 (mending heart; Unicode: U+2764 U+FE0F U+200D U+1FA79) which is comprised of more than one Unicode code point, if the caret is at the end of the composite character. Also returns the correct column with the caret at mid grapheme and for non-composite characters.
Note: To check at caret location use get_previous_composite_character_column(get_caret_line(), get_caret_column())
Rect2i get_rect_at_line_column(line: int, column: int) 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 get_pos_at_line_column() which returns the bottom side.
int get_saved_version() const 🔗
Returns the last tagged saved version from tag_saved_version().
float get_scroll_pos_for_line(line: int, wrap_index: int = 0) const 🔗
Returns the scroll position for wrap_index of line.
String get_selected_text(caret_index: int = -1) 🔗
Returns the text inside the selection of a caret, or all the carets if caret_index is its default value -1.
int get_selection_at_line_column(line: int, column: int, include_edges: bool = true, only_selections: bool = true) const 🔗
Returns the caret index of the selection at the given line and column, or -1 if there is none.
If include_edges is false, the position must be inside the selection and not at either end. If only_selections is false, carets without a selection will also be considered.
int get_selection_column(caret_index: int = 0) const 🔗
Obsolète : Use get_selection_origin_column() instead.
Returns the original start column of the selection.
int get_selection_from_column(caret_index: int = 0) const 🔗
Returns the selection begin column. Returns the caret column if there is no selection.
int get_selection_from_line(caret_index: int = 0) const 🔗
Returns the selection begin line. Returns the caret line if there is no selection.
int get_selection_line(caret_index: int = 0) const 🔗
Obsolète : Use get_selection_origin_line() instead.
Returns the original start line of the selection.
SelectionMode get_selection_mode() const 🔗
Renvoie le mode de sélection actuel.
int get_selection_origin_column(caret_index: int = 0) const 🔗
Returns the origin column of the selection. This is the opposite end from the caret.
int get_selection_origin_line(caret_index: int = 0) const 🔗
Returns the origin line of the selection. This is the opposite end from the caret.
int get_selection_to_column(caret_index: int = 0) const 🔗
Returns the selection end column. Returns the caret column if there is no selection.
int get_selection_to_line(caret_index: int = 0) const 🔗
Returns the selection end line. Returns the caret line if there is no selection.
PackedInt32Array get_sorted_carets(include_ignored_carets: bool = false) const 🔗
Returns the carets sorted by selection beginning from lowest line and column to highest (from top to bottom of text).
If include_ignored_carets is false, carets from multicaret_edit_ignore_caret() will be ignored.
Renvoie la taille des tabulations du TextEdit.
int get_total_gutter_width() const 🔗
Returns the total width of all gutters and internal padding.
int get_total_visible_line_count() const 🔗
Returns the total number of lines in the text. This includes wrapped lines and excludes folded lines. If wrap_mode is set to LINE_WRAPPING_NONE and no lines are folded (see CodeEdit.is_line_folded()) then this is equivalent to get_line_count(). See get_visible_line_count_in_range() for a limited range of lines.
VScrollBar get_v_scroll_bar() const 🔗
Returns the VScrollBar of the TextEdit.
Returns the current version of the TextEdit. The version is a count of recorded operations by the undo/redo history.
int get_visible_line_count() const 🔗
Returns the number of lines that can visually fit, rounded down, based on this control's height.
int get_visible_line_count_in_range(from_line: int, to_line: int) const 🔗
Returns the total number of lines between from_line and to_line (inclusive) in the text. This includes wrapped lines and excludes folded lines. If the range covers all lines it is equivalent to get_total_visible_line_count().
String get_word_at_pos(position: Vector2) const 🔗
Returns the word at position.
String get_word_under_caret(caret_index: int = -1) const 🔗
Returns a String text with the word under the caret's location.
Renvoie true si l'utilisateur a du texte dans l'éditeur de méthode de saisie (Input Method Editor).
Renvoie true si une action « refaire » (redo) est disponible.
bool has_selection(caret_index: int = -1) const 🔗
Renvoie true si l'utilisateur a sélectionné du texte.
Renvoie true si une action « annuler » (undo) est disponible.
void insert_line_at(line: int, text: String) 🔗
Inserts a new line with text at line.
void insert_text(text: String, line: int, column: int, before_selection_begin: bool = true, before_selection_end: bool = false) 🔗
Inserts the text at line and column.
If before_selection_begin is true, carets and selections that begin at line and column will moved to the end of the inserted text, along with all carets after it.
If before_selection_end is true, selections that end at line and column will be extended to the end of the inserted text. These parameters can be used to insert text inside of or outside of selections.
void insert_text_at_caret(text: String, caret_index: int = -1) 🔗
Insert the specified text at the caret position.
bool is_caret_after_selection_origin(caret_index: int = 0) const 🔗
Returns true if the caret of the selection is after the selection origin. This can be used to determine the direction of the selection.
bool is_caret_visible(caret_index: int = 0) const 🔗
Returns true if the caret is visible, false otherwise. A caret will be considered hidden if it is outside the scrollable area when scrolling is enabled.
Note: is_caret_visible() does not account for a caret being off-screen if it is still within the scrollable area. It will return true even if the caret is off-screen as long as it meets TextEdit's own conditions for being visible. This includes uses of scroll_fit_content_width and scroll_fit_content_height that cause the TextEdit to expand beyond the viewport's bounds.
Note: This method does not guarantee an accurate visibility check immediately after setting the caret position. The correct value may only be available in the next frame after the TextEdit has finished drawing. This also applies to any operation that causes the TextEdit to change in size.
bool is_dragging_cursor() const 🔗
Returns true if the user is dragging their mouse for scrolling, selecting, or text dragging.
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 🔗
Renvoie true si une begin_multicaret_edit() a été appelée et que end_multicaret_edit() n'a pas encore été appelée.
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_in_viewport(line: int) const 🔗
Returns true if the given line is within the scope of the scrollable area of the viewport.
bool is_line_wrapped(line: int) const 🔗
Returns if the given line is wrapped.
Returns true if the menu is visible. Use this instead of get_menu().visible to improve performance (so the creation of the menu is avoided). See get_menu().
bool is_mouse_over_selection(edges: bool, caret_index: int = -1) const 🔗
Returns true if the mouse is over a selection. If edges is true, the edges are considered part of the selection.
bool is_overtype_mode_enabled() const 🔗
Returns true if overtype mode is enabled. See set_overtype_mode_enabled().
Exécute l'action donnée comme définit par l'énumération MenuItems.
void merge_gutters(from_line: int, to_line: int) 🔗
Merge the gutters from from_line into to_line. Only overwritable gutters will be copied. See set_gutter_overwritable().
void merge_overlapping_carets() 🔗
Merges any overlapping carets. Will favor the newest caret, or the caret with a selection.
If is_in_mulitcaret_edit() is true, the merge will be queued to happen at the end of the multicaret edit. See begin_multicaret_edit() and end_multicaret_edit().
Note: This is not called when a caret changes position but after certain actions, so it is possible to get into a state where carets overlap.
bool multicaret_edit_ignore_caret(caret_index: int) const 🔗
Returns true if the given caret_index should be ignored as part of a multicaret edit. See begin_multicaret_edit() and end_multicaret_edit(). Carets that should be ignored are ones that were part of removed text and will likely be merged at the end of the edit, or carets that were added during the edit.
It is recommended to continue within a loop iterating on multiple carets if a caret should be ignored.
void paste(caret_index: int = -1) 🔗
Paste at the current location. Can be overridden with _paste().
void paste_primary_clipboard(caret_index: int = -1) 🔗
Colle le presse-papier primaire.
void redo() 🔗
Effectue une opération refaire.
void remove_caret(caret: int) 🔗
Removes the given caret index.
Note: This can result in adjustment of all other caret indices.
void remove_gutter(gutter: int) 🔗
Removes the gutter at the given index.
void remove_line_at(line: int, move_carets_down: bool = true) 🔗
Removes the line of text at line. Carets on this line will attempt to match their previous visual x position.
If move_carets_down is true carets will move to the next line down, otherwise carets will move up.
void remove_secondary_carets() 🔗
Removes all additional carets.
void remove_text(from_line: int, from_column: int, to_line: int, to_column: int) 🔗
Removes text between the given positions.
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() 🔗
Sélectionne tout le texte.
Si selecting_enabled est false, aucun sélection ne se fera.
void select_word_under_caret(caret_index: int = -1) 🔗
Sélectionne le mot sous le curseur.
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) 🔗
Définit le mode de sélection actuel.
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) 🔗
Swaps the two lines. Carets will be swapped with the lines.
void tag_saved_version() 🔗
Marque la version actuelle comme sauvegardée.
void undo() 🔗
Effectuer une opération d'annulation.
Descriptions des propriétés du thème
Color background_color = Color(0, 0, 0, 0) 🔗
Définit la Color d'arrière-plan pour ce TextEdit.
Color caret_background_color = Color(0, 0, 0, 1) 🔗
Color of the text behind the caret when using a block caret.
Color caret_color = Color(0.875, 0.875, 0.875, 1) 🔗
Color of the caret. This can be set to a fully transparent color to hide the caret entirely.
Color current_line_color = Color(0.25, 0.25, 0.26, 0.8) 🔗
Background Color of the line containing the caret.
Color font_color = Color(0.875, 0.875, 0.875, 1) 🔗
Définit la police Color.
Color font_outline_color = Color(0, 0, 0, 1) 🔗
The tint of text outline of the TextEdit.
Color font_placeholder_color = Color(0.875, 0.875, 0.875, 0.6) 🔗
Couleur de police pour placeholder_text.
Color font_readonly_color = Color(0.875, 0.875, 0.875, 0.5) 🔗
Sets the font Color when editable is disabled.
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 de la bordure autour du texte qui correspond à la requête de recherche.
Color search_result_color = Color(0.3, 0.3, 0.3, 1) 🔗
Color derrière le texte qui correspond à la requête de recherche.
Color selection_color = Color(0.5, 0.5, 0.5, 1) 🔗
Définit la Color de surlignage pour la sélection de texte.
Color word_highlighted_color = Color(0.5, 0.5, 0.5, 0.25) 🔗
Définir la Color de surlignage des multiples occurrences. highlight_all_occurrences doit être actif.
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.
Espacement vertical supplémentaire entre les lignes (en pixels), l'espacement est ajouté à la descente de la ligne. Cette valeur peut être négative.
La taille du contour du texte.
Note : Si vous utilisez une police avec FontFile.multichannel_signed_distance_field activé, sa propriété FontFile.msdf_pixel_range doit être définie à au moins deux fois la valeur de outline_size pour que le rendu des contours soit correct. Sinon, le contour peut sembler coupé plus tôt que prévu.
Sets an additional margin for line wrapping width.
Définit la Font par défaut.
Définit la taille de police par défaut.
Sets a custom Texture2D for space text characters.
Définit une Texture2D personnalisée pour le caractère de tabulation.
Sets the StyleBox when in focus. The focus StyleBox is displayed over the base StyleBox, so a partially transparent StyleBox should be used to ensure the base StyleBox remains visible. A StyleBox that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a StyleBoxEmpty resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
Définit la StyleBox pour ce TextEdit.
Définit la StyleBox de ce TextEdit quand editable est désactivé.