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...
TextMesh
Eredita: PrimitiveMesh < Mesh < Resource < RefCounted < Object
Genera un PrimitiveMesh dal testo.
Descrizione
Genera un PrimitiveMesh dal testo.
È possibile generare un TextMesh solo quando si utilizzano font dinamici con contorni di glifi vettoriali. I caratteri bitmap (compresi i dati bitmap nei contenitori TrueType/OpenType, come i caratteri emoji a colori) non sono supportati.
Il layout UV è disposto in 4 fasce orizzontali, dall'alto verso il basso: 40% dell'altezza per la faccia anteriore, 40% per la faccia posteriore, 10% per i bordi esterni e 10% per i bordi interni.
Tutorial
Proprietà
|
||
|
||
|
||
|
||
|
||
BitField[JustificationFlag] |
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Descrizioni delle proprietà
AutowrapMode autowrap_mode = 0 🔗
void set_autowrap_mode(value: AutowrapMode)
AutowrapMode get_autowrap_mode()
Se impostato su un valore diverso da TextServer.AUTOWRAP_OFF, il testo è avvolto all'interno del rettangolo di delimitazione del nodo. Se ridimensioni il nodo, cambierà automaticamente la sua altezza per mostrare tutto il testo.
Step (in pixels) used to approximate Bézier curves. Lower values result in smoother curves, but is slower to generate and render. Consider adjusting this according to the font size and the typical viewing distance.
Note: Changing this property will regenerate the mesh, which is a slow operation, especially with large font sizes and long texts.
La profondità della mesh, se impostata su 0.0, è generata solo sulla superficie anteriore e il layout UV è modificato per utilizzare la texture completa solo per la faccia anteriore.
Configurazione del font utilizzata per visualizzare il testo.
Font size of the TextMesh's text. This property works in tandem with pixel_size. Higher values will result in a more detailed font, regardless of curve_step and pixel_size. Consider keeping this value below 63 (inclusive) for good performance, and adjust pixel_size as needed to enlarge text.
Note: Changing this property will regenerate the mesh, which is a slow operation, especially with large font sizes and long texts. To change the text's size in real-time efficiently, change the node's Node3D.scale instead.
HorizontalAlignment horizontal_alignment = 1 🔗
void set_horizontal_alignment(value: HorizontalAlignment)
HorizontalAlignment get_horizontal_alignment()
Controlla l'allineamento orizzontale del testo. Supporta sinistra, centro, destra, e riempi (noto anche come giustifica).
BitField[JustificationFlag] justification_flags = 163 🔗
void set_justification_flags(value: BitField[JustificationFlag])
BitField[JustificationFlag] get_justification_flags()
Regole di allineamento del riempimento per le righe.
Language code used for line-breaking and text shaping algorithms. If left empty, the current locale is used instead.
Spaziatura verticale aggiuntiva tra le righe (in pixel), la spaziatura è aggiunta alla discesa della riga. Questo valore può essere negativo.
Vector2 offset = Vector2(0, 0) 🔗
The text drawing offset (in pixels).
Note: Changing this property will regenerate the mesh, which is a slow operation. To change the text's position in real-time efficiently, change the node's Node3D.position instead.
The size of one pixel's width on the text to scale it in 3D. This property works in tandem with font_size.
Note: Changing this property will regenerate the mesh, which is a slow operation, especially with large font sizes and long texts. To change the text's size in real-time efficiently, change the node's Node3D.scale instead.
StructuredTextParser structured_text_bidi_override = 0 🔗
void set_structured_text_bidi_override(value: StructuredTextParser)
StructuredTextParser get_structured_text_bidi_override()
Imposta la sostituzione dell'algoritmo BiDi per il testo strutturato.
Array structured_text_bidi_override_options = [] 🔗
void set_structured_text_bidi_override_options(value: Array)
Array get_structured_text_bidi_override_options()
Imposta opzioni aggiuntive per la sostituzione BiDi.
Il testo da cui generare la mesh.
Nota: Essendo una Resource, non segue le regole di Node.auto_translate_mode. Se si desidera disabilitare la traduzione, è necessario farlo manualmente con Object.set_message_translation().
Direction text_direction = 0 🔗
Direzione di scrittura del testo di base.
Se true, tutto il testo è visualizzato in MAIUSCOLO.
VerticalAlignment vertical_alignment = 1 🔗
void set_vertical_alignment(value: VerticalAlignment)
VerticalAlignment get_vertical_alignment()
Controlla l'allineamento verticale del testo. Supporta sopra, centro, sotto.
La larghezza del testo (in pixel), usata per l'allineamento di riempimento.