TextParagraph
Hereda: RefCounted < Object
Contiene un párrafo de texto.
Descripción
Abstracción sobre TextServer para manejar un único párrafo de texto.
Propiedades
|
||
BitField[LineBreakFlag] |
|
|
|
||
|
||
|
||
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 |
|
void |
draw(canvas: RID, pos: Vector2, color: Color = Color(1, 1, 1, 1), dc_color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const |
void |
draw_dropcap(canvas: RID, pos: Vector2, color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const |
void |
draw_dropcap_outline(canvas: RID, pos: Vector2, outline_size: int = 1, color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const |
void |
draw_line(canvas: RID, pos: Vector2, line: int, color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const |
void |
draw_line_outline(canvas: RID, pos: Vector2, line: int, outline_size: int = 1, 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), dc_color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const |
get_dropcap_lines() const |
|
get_dropcap_rid() const |
|
get_dropcap_size() const |
|
get_inferred_direction() const |
|
get_line_ascent(line: int) const |
|
get_line_count() const |
|
get_line_descent(line: int) const |
|
get_line_object_rect(line: int, key: Variant) const |
|
get_line_objects(line: int) const |
|
get_line_range(line: int) const |
|
get_line_rid(line: int) const |
|
get_line_size(line: int) const |
|
get_line_underline_position(line: int) const |
|
get_line_underline_thickness(line: int) const |
|
get_line_width(line: int) const |
|
get_non_wrapped_size() const |
|
get_range() const |
|
get_rid() const |
|
get_size() const |
|
resize_object(key: Variant, size: Vector2, inline_align: InlineAlignment = 5, baseline: float = 0.0) |
|
void |
set_bidi_override(override: Array) |
set_dropcap(text: String, font: Font, font_size: int, dropcap_margins: Rect2 = Rect2(0, 0, 0, 0), language: String = "") |
|
void |
tab_align(tab_stops: PackedFloat32Array) |
Descripciones de Propiedades
HorizontalAlignment alignment = 0 🔗
void set_alignment(value: HorizontalAlignment)
HorizontalAlignment get_alignment()
Alineación horizontal del párrafo.
BitField[LineBreakFlag] break_flags = 3 🔗
void set_break_flags(value: BitField[LineBreakFlag])
BitField[LineBreakFlag] get_break_flags()
Reglas de salto de línea. Para más información, véase TextServer.
String custom_punctuation = "" 🔗
Lista de caracteres de puntuación personalizados, utilizada para la división de palabras. Si se establece en una string vacía, se utilizan los valores predeterminados del servidor.
Dirección de escritura del texto.
Carácter de elipsis utilizado para el recorte de texto.
BitField[JustificationFlag] justification_flags = 163 🔗
void set_justification_flags(value: BitField[JustificationFlag])
BitField[JustificationFlag] get_justification_flags()
Reglas de alineación de relleno de línea.
Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
Limita las líneas de texto mostradas.
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 = 0 🔗
void set_text_overrun_behavior(value: OverrunBehavior)
OverrunBehavior get_text_overrun_behavior()
El comportamiento de recorte cuando el texto excede el ancho establecido del párrafo.
Ancho de párrafo.
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 el párrafo de texto (elimina el texto y los objetos en línea).
void clear_dropcap() 🔗
Removes dropcap.
void draw(canvas: RID, pos: Vector2, color: Color = Color(1, 1, 1, 1), dc_color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const 🔗
Draw all lines of the text and drop cap 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_dropcap(canvas: RID, pos: Vector2, color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const 🔗
Draw drop cap 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_dropcap_outline(canvas: RID, pos: Vector2, outline_size: int = 1, color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const 🔗
Draw drop cap outline 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_line(canvas: RID, pos: Vector2, line: int, color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const 🔗
Draw single line of 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_line_outline(canvas: RID, pos: Vector2, line: int, outline_size: int = 1, color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const 🔗
Draw outline of the single line of 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), dc_color: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) const 🔗
Dibuja los contornos de todas las líneas del texto y la letra capital en un elemento del canvas en una posición dada, con color. pos especifica la esquina superior izquierda del cuadro delimitador. Si oversampling es mayor que cero, se utiliza como factor de sobremuestreo de la fuente, de lo contrario, se utilizan los ajustes de sobremuestreo del viewport.
int get_dropcap_lines() const 🔗
Devuelve el número de líneas usadas por la letra capital.
Devuelve el RID del búfer de texto de la letra capital.
Vector2 get_dropcap_size() const 🔗
Devuelve el tamaño del cuadro delimitador de la letra capital.
Direction get_inferred_direction() const 🔗
Returns the text writing direction inferred by the BiDi algorithm.
float get_line_ascent(line: int) const 🔗
Returns the text line ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
Devuelve el número de líneas en el párrafo.
float get_line_descent(line: int) const 🔗
Devuelve el descenso de la línea de texto (número de píxeles por debajo de la línea base para el diseño horizontal o a la derecha de la línea base para el diseño vertical).
Rect2 get_line_object_rect(line: int, key: Variant) const 🔗
Returns bounding rectangle of the inline object.
Array get_line_objects(line: int) const 🔗
Devuelve un array de objetos en línea en la línea.
Vector2i get_line_range(line: int) const 🔗
Devuelve el rango de caracteres de la línea.
RID get_line_rid(line: int) const 🔗
Devuelve el RID del búfer de línea de TextServer.
Vector2 get_line_size(line: int) const 🔗
Devuelve el tamaño del cuadro delimitador de la línea de texto. El tamaño devuelto se redondea hacia arriba.
float get_line_underline_position(line: int) const 🔗
Devuelve el desplazamiento de píxeles del subrayado debajo de la línea base.
float get_line_underline_thickness(line: int) const 🔗
Returns thickness of the underline.
float get_line_width(line: int) const 🔗
Devuelve el ancho (para diseño horizontal) o la altura (para vertical) de la línea de texto.
Vector2 get_non_wrapped_size() const 🔗
Devuelve el tamaño del cuadro delimitador del párrafo, sin saltos de línea.
Devuelve el rango de caracteres del párrafo.
Devuelve el RID del búfer de string completo de TextServer.
Devuelve el tamaño del cuadro delimitador del párrafo.
int hit_test(coords: Vector2) const 🔗
Devuelve el desplazamiento del cursor en las coordenadas especificadas. 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.
bool set_dropcap(text: String, font: Font, font_size: int, dropcap_margins: Rect2 = Rect2(0, 0, 0, 0), language: String = "") 🔗
Establece la letra capital, sobreescribiendo la letra capital establecida previamente. La letra capital (letra capital caída) es un elemento decorativo al principio de un párrafo que es más grande que el resto del texto.
void tab_align(tab_stops: PackedFloat32Array) 🔗
Alinea un párrafo a las tabulaciones dadas.