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()
Sets text alignment within the line as if the line was 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, consulta 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.
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 🔗
Devuelve el desplazamiento de píxeles del subrayado debajo de la línea base.
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.
Devuelve un array de objetos en la línea.
Devuelve el RID del búfer de 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 🔗
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) 🔗
Sets new size and alignment of embedded object.
void set_bidi_override(override: Array) 🔗
Overrides BiDi for the structured text.
Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
void tab_align(tab_stops: PackedFloat32Array) 🔗
Alinea el texto con las tabulaciones indicadas.