TextMesh
Inherits:PrimitiveMesh<Mesh<Resource<RefCounted<Object
Generate anPrimitiveMesh from the text.
Description
Generate anPrimitiveMesh from the text.
TextMesh can be generated only when using dynamic fonts with vector glyph contours. Bitmap fonts (including bitmap data in the TrueType/OpenType containers, like color emoji fonts) are not supported.
The UV layout is arranged in 4 horizontal strips, top to bottom: 40% of the height for the front face, 40% for the back face, 10% for the outer edges and 10% for the inner edges.
Tutorials
Properties
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
Property Descriptions
AutowrapModeautowrap_mode =0
🔗
AutowrapModeget_autowrap_mode()
If set to something other thanTextServer.AUTOWRAP_OFF, the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, seeAutowrapMode.
floatget_curve_step()
Step (in pixels) used to approximate Bézier curves.
floatget_depth()
Depths of the mesh, if set to0.0
only front surface, is generated, and UV layout is changed to use full texture for the front face only.
Fontget_font()
Font configuration used to display text.
intget_font_size()
Font size of theTextMesh's text.
HorizontalAlignmenthorizontal_alignment =1
🔗
HorizontalAlignmentget_horizontal_alignment()
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of theHorizontalAlignment constants.
BitField[JustificationFlag]justification_flags =163
🔗
voidset_justification_flags(value:BitField[JustificationFlag])
BitField[JustificationFlag]get_justification_flags()
Line fill alignment rules. SeeJustificationFlag for more information.
Stringget_language()
Language code used for text shaping algorithms, if left empty current locale is used instead.
floatget_line_spacing()
Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
Vector2get_offset()
The text drawing offset (in pixels).
floatget_pixel_size()
The size of one pixel's width on the text to scale it in 3D.
StructuredTextParserstructured_text_bidi_override =0
🔗
voidset_structured_text_bidi_override(value:StructuredTextParser)
StructuredTextParserget_structured_text_bidi_override()
Set BiDi algorithm override for the structured text.
Arraystructured_text_bidi_override_options =[]
🔗
Arrayget_structured_text_bidi_override_options()
Set additional options for BiDi override.
Stringget_text()
The text to generate mesh from.
Note: Due to being aResource, it doesn't follow the rules ofNode.auto_translate_mode. If disabling translation is desired, it should be done manually withObject.set_message_translation().
Directionget_text_direction()
Base text writing direction.
boolis_uppercase()
Iftrue
, all the text displays as UPPERCASE.
VerticalAlignmentvertical_alignment =1
🔗
VerticalAlignmentget_vertical_alignment()
Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of theVerticalAlignment constants.
floatget_width()
Text width (in pixels), used for fill alignment.