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
Hereda: RefCounted < Object
Contiene una línea de texto.
Descripción
Abstracción sobre TextServer para manejar una sola línea de texto.
Propiedades
|
||
|
||
|
||
BitField[JustificationFlag] |
|
|
|
||
|
||
|
||
|
||
|
Métodos
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) |
Descripciones de Propiedades
HorizontalAlignment alignment = 0 🔗
void set_horizontal_alignment(value: HorizontalAlignment)
HorizontalAlignment get_horizontal_alignment()
Establece la alineación del texto dentro de la línea como si la línea fuera horizontal.
Dirección de escritura del texto.
Carácter de elipsis utilizado para el recorte de texto.
BitField[JustificationFlag] flags = 3 🔗
void set_flags(value: BitField[JustificationFlag])
BitField[JustificationFlag] get_flags()
Reglas de alineación de línea. Para más información, véase TextServer.
Orientation orientation = 0 🔗
void set_orientation(value: Orientation)
Orientation get_orientation()
Orientación del texto.
bool preserve_control = false 🔗
Si se establece a true, el texto mostrará caracteres de control.
bool preserve_invalid = true 🔗
Si se establece a true, el texto mostrará caracteres inválidos.
OverrunBehavior text_overrun_behavior = 3 🔗
void set_text_overrun_behavior(value: OverrunBehavior)
OverrunBehavior get_text_overrun_behavior()
El comportamiento de recorte cuando el texto excede el ancho establecido de la línea de texto.
El ancho de la línea de texto.
Descripciones de Métodos
bool add_object(key: Variant, size: Vector2, inline_align: InlineAlignment = 5, length: int = 1, baseline: float = 0.0) 🔗
Añade un objeto en línea al buffer de texto, key debe ser único. En el texto, el objeto se representa como length caracteres de reemplazo de objeto.
bool add_string(text: String, font: Font, font_size: int, language: String = "", meta: Variant = null) 🔗
Agrega espacio de texto y fuente para dibujarlo.
void clear() 🔗
Limpia la línea de texto (elimina el texto y los objetos en línea).
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.
Duplica este TextLine.
Direction get_inferred_direction() const 🔗
Devuelve la dirección de escritura del texto inferida por el algoritmo BiDi.
float get_line_ascent() const 🔗
Devuelve el ascenso del texto (número de píxeles por encima de la línea de base para diseño horizontal o a la izquierda de la línea de base para vertical).
float get_line_descent() const 🔗
Devuelve el descenso del texto (número de píxeles por debajo de la línea de base para diseño horizontal o a la derecha de la línea de base para vertical).
float get_line_underline_position() const 🔗
Devuelve el desplazamiento de píxeles del subrayado debajo de la línea base.
float get_line_underline_thickness() const 🔗
Devuelve el grosor del subrayado.
float get_line_width() const 🔗
Devuelve el ancho (para diseño horizontal) o la altura (para vertical) del texto.
Rect2 get_object_rect(key: Variant) const 🔗
Devuelve el rectángulo delimitador del objeto en línea.
Devuelve un array de objetos en la línea.
Devuelve el RID del búfer de TextServer.
Devuelve el tamaño del cuadro delimitador del texto.
bool has_object(key: Variant) const 🔗
Devuelve true si un objeto con key está incrustado en esta línea.
int hit_test(coords: float) const 🔗
Devuelve el desplazamiento del cursor en el píxel especificado en la línea base. Esta función siempre devuelve una posición válida.
bool resize_object(key: Variant, size: Vector2, inline_align: InlineAlignment = 5, baseline: float = 0.0) 🔗
Establece el nuevo tamaño y alineación del objeto incrustado.
void set_bidi_override(override: Array) 🔗
Sobreescribe BiDi para el texto estructurado.
Los rangos de sobreescritura deben cubrir el texto fuente completo sin superposiciones. El algoritmo BiDi se utilizará en cada rango por separado.
void tab_align(tab_stops: PackedFloat32Array) 🔗
Alinea el texto con las tabulaciones indicadas.