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.

CodeHighlighter

Hérite de : SyntaxHighlighter < Resource < RefCounted < Object

A syntax highlighter intended for code.

Description

By adjusting various properties of this resource, you can change the colors of strings, comments, numbers, and other text patterns inside a TextEdit control.

Propriétés

Dictionary

color_regions

{}

Color

function_color

Color(0, 0, 0, 1)

Dictionary

keyword_colors

{}

Dictionary

member_keyword_colors

{}

Color

member_variable_color

Color(0, 0, 0, 1)

Color

number_color

Color(0, 0, 0, 1)

Color

symbol_color

Color(0, 0, 0, 1)

Méthodes

void

add_color_region(start_key: String, end_key: String, color: Color, line_only: bool = false)

void

add_keyword_color(keyword: String, color: Color)

void

add_member_keyword_color(member_keyword: String, color: Color)

void

clear_color_regions()

void

clear_keyword_colors()

void

clear_member_keyword_colors()

Color

get_keyword_color(keyword: String) const

Color

get_member_keyword_color(member_keyword: String) const

bool

has_color_region(start_key: String) const

bool

has_keyword_color(keyword: String) const

bool

has_member_keyword_color(member_keyword: String) const

void

remove_color_region(start_key: String)

void

remove_keyword_color(keyword: String)

void

remove_member_keyword_color(member_keyword: String)


Descriptions des propriétés

Dictionary color_regions = {} 🔗

Définit les régions de couleur. Toutes les régions existantes seront supprimées. La clé du Dictionary est la clé de départ et de fin de la région, séparés par un espace. La valeur est la couleur de région.


Color function_color = Color(0, 0, 0, 1) 🔗

  • void set_function_color(value: Color)

  • Color get_function_color()

Définit la couleur pour les fonctions. Une fonction est une chaîne de mots non-clé suivis d'un '('.


Dictionary keyword_colors = {} 🔗

Définit les couleurs des mot-clés. Tous les mots-clés existants seront supprimés. La clé du Dictionary est le mot-clé. La valeur est la couleur du mot-clé.


Dictionary member_keyword_colors = {} 🔗

Sets the member keyword colors. All existing member keyword will be removed. The Dictionary key is the member keyword. The value is the member keyword color.


Color member_variable_color = Color(0, 0, 0, 1) 🔗

  • void set_member_variable_color(value: Color)

  • Color get_member_variable_color()

Définit la couleur pour les variables membres. Une variable membre est une chaîne non-mot-clé, non-fonction précédée d'un '.'.


Color number_color = Color(0, 0, 0, 1) 🔗

  • void set_number_color(value: Color)

  • Color get_number_color()

Définit la couleur pour les nombres.


Color symbol_color = Color(0, 0, 0, 1) 🔗

  • void set_symbol_color(value: Color)

  • Color get_symbol_color()

Définit la couleur pour les symboles.


Descriptions des méthodes

void add_color_region(start_key: String, end_key: String, color: Color, line_only: bool = false) 🔗

Adds a color region (such as for comments or strings) from start_key to end_key. Both keys should be symbols, and start_key must not be shared with other delimiters.

If line_only is true or end_key is an empty String, the region does not carry over to the next line.


void add_keyword_color(keyword: String, color: Color) 🔗

Définit la couleur pour un mot-clé.

Le mot-clé ne peut contenir aucun symbole sauf '_'.


void add_member_keyword_color(member_keyword: String, color: Color) 🔗

Sets the color for a member keyword.

The member keyword cannot contain any symbols except '_'.

It will not be highlighted if preceded by a '.'.


void clear_color_regions() 🔗

Supprime toutes les régions de couleur.


void clear_keyword_colors() 🔗

Supprime tout les mots-clés.


void clear_member_keyword_colors() 🔗

Removes all member keywords.


Color get_keyword_color(keyword: String) const 🔗

Renvoie la couleur d'un mot-clé.


Color get_member_keyword_color(member_keyword: String) const 🔗

Returns the color for a member keyword.


bool has_color_region(start_key: String) const 🔗

Renvoie true si la clé de départ start_key existe, sinon false.


bool has_keyword_color(keyword: String) const 🔗

Renvoie true si le mot-clé keyword existe, sinon false.


bool has_member_keyword_color(member_keyword: String) const 🔗

Returns true if the member keyword exists, else false.


void remove_color_region(start_key: String) 🔗

Retire la région de couleur qui utilise cette clé de départ.


void remove_keyword_color(keyword: String) 🔗

Supprime le mot-clé.


void remove_member_keyword_color(member_keyword: String) 🔗

Removes the member keyword.