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...
TextLine
Hérite de : RefCounted < Object
Contient une ligne de texte.
Description
Abstraction sur TextServer pour la manipulation d'une seule ligne de texte.
Propriétés
|
||
|
||
|
||
BitField[JustificationFlag] |
|
|
|
||
|
||
|
||
|
||
|
Méthodes
add_object(key: Variant, size: Vector2, inline_align: InlineAlignment = 5, length: int = 1, baseline: float = 0.0) |
|
add_string(text: String, font: Font, font_size: int, language: String = "", meta: Variant = null) |
|
void |
clear() |
void |
draw(canvas: RID, pos: Vector2, color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const |
void |
draw_outline(canvas: RID, pos: Vector2, outline_size: int = 1, color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const |
duplicate() const |
|
get_inferred_direction() const |
|
get_line_ascent() const |
|
get_line_descent() const |
|
get_line_underline_position() const |
|
get_line_underline_thickness() const |
|
get_line_width() const |
|
get_object_rect(key: Variant) const |
|
get_objects() const |
|
get_rid() const |
|
get_size() const |
|
has_object(key: Variant) const |
|
resize_object(key: Variant, size: Vector2, inline_align: InlineAlignment = 5, baseline: float = 0.0) |
|
void |
set_bidi_override(override: Array) |
void |
tab_align(tab_stops: PackedFloat32Array) |
Descriptions des propriétés
HorizontalAlignment alignment = 0 🔗
void set_horizontal_alignment(value: HorizontalAlignment)
HorizontalAlignment get_horizontal_alignment()
Définit l'alignement de texte dans la ligne comme si la ligne était horizontale.
Direction d'écriture du texte.
Caractère d’ellipse utilisé pour tronquer du texte.
BitField[JustificationFlag] flags = 3 🔗
void set_flags(value: BitField[JustificationFlag])
BitField[JustificationFlag] get_flags()
Règles d'alignement de la ligne. Pour plus d'informations, voir TextServer.
Orientation orientation = 0 🔗
void set_orientation(value: Orientation)
Orientation get_orientation()
Orientation du texte.
bool preserve_control = false 🔗
Si défini à true, le texte affichera les caractères de contrôle.
bool preserve_invalid = true 🔗
Si défini à true, le texte affichera les caractères invalides.
OverrunBehavior text_overrun_behavior = 3 🔗
void set_text_overrun_behavior(value: OverrunBehavior)
OverrunBehavior get_text_overrun_behavior()
Le comportement de coupure lorsque le texte dépasse la largeur de la ligne de texte.
La largeur de la ligne de texte.
Descriptions des méthodes
bool add_object(key: Variant, size: Vector2, inline_align: InlineAlignment = 5, length: int = 1, baseline: float = 0.0) 🔗
Adds inline object to the text buffer, key must be unique. In the text, object is represented as length object replacement characters.
bool add_string(text: String, font: Font, font_size: int, language: String = "", meta: Variant = null) 🔗
Adds text span and font to draw it.
void clear() 🔗
Clears text line (removes text and inline objects).
void draw(canvas: RID, pos: Vector2, color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const 🔗
Draw text into a canvas item at a given position, with color. pos specifies the top left corner of the bounding box. If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
void draw_outline(canvas: RID, pos: Vector2, outline_size: int = 1, color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const 🔗
Draw text into a canvas item at a given position, with color. pos specifies the top left corner of the bounding box. If oversampling is greater than zero, it is used as font oversampling factor, otherwise viewport oversampling settings are used.
Duplicates this TextLine.
Direction get_inferred_direction() const 🔗
Returns the text writing direction inferred by the BiDi algorithm.
float get_line_ascent() const 🔗
Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
float get_line_descent() const 🔗
Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
float get_line_underline_position() const 🔗
Returns pixel offset of the underline below the baseline.
float get_line_underline_thickness() const 🔗
Returns thickness of the underline.
float get_line_width() const 🔗
Returns width (for horizontal layout) or height (for vertical) of the text.
Rect2 get_object_rect(key: Variant) const 🔗
Returns bounding rectangle of the inline object.
Returns array of inline objects.
Renvoie le RID de buffer du TextServer.
Returns size of the bounding box of the text.
bool has_object(key: Variant) const 🔗
Returns true if an object with key is embedded in this line.
int hit_test(coords: float) const 🔗
Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
bool resize_object(key: Variant, size: Vector2, inline_align: InlineAlignment = 5, baseline: float = 0.0) 🔗
Définit la nouvelle taille et alignement de l'objet intégré.
void set_bidi_override(override: Array) 🔗
Redéfinit la BiDi pour le texte structuré.
Les plages de redéfinition devraient couvrir le texte source complet sans chevauchements. L'algorithme BiDi sera utilisé sur chaque plage séparément.
void tab_align(tab_stops: PackedFloat32Array) 🔗
Aligns text to the given tab-stops.