Class reference
TextMesh
Inherits PrimitiveMesh
Generate a PrimitiveMesh from the text.
Description
Generate a PrimitiveMesh 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.
Properties
int autowrap_mode = 0
int autowrap_mode = 0If set to something other than TextServer.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.
float curve_step = 0.5
float curve_step = 0.5Step (in pixels) used to approximate Bézier curves.
float depth = 0.05
float depth = 0.05Depths of the mesh, if set to 0.0 only front surface, is generated, and UV layout is changed to use full texture for the front face only.
Font font
Font fontFont configuration used to display text.
int font_size = 16
int font_size = 16Font size of the TextMesh's text.
int horizontal_alignment = 1
int horizontal_alignment = 1Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify.
int justification_flags = 163
int justification_flags = 163Line fill alignment rules.
String language = ""
String language = ""Language code used for text shaping algorithms, if left empty current locale is used instead.
float line_spacing = 0.0
float line_spacing = 0.0Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
Vector2 offset = Vector2(0, 0)
Vector2 offset = Vector2(0, 0)The text drawing offset (in pixels).
float pixel_size = 0.01
float pixel_size = 0.01The size of one pixel's width on the text to scale it in 3D.
int structured_text_bidi_override = 0
int structured_text_bidi_override = 0Set BiDi algorithm override for the structured text.
Array structured_text_bidi_override_options = []
Array structured_text_bidi_override_options = []Set additional options for BiDi override.
String text = ""
String text = ""The text to generate mesh from. Note: Due to being a Resource, it doesn't follow the rules of Node.auto_translate_mode. If disabling translation is desired, it should be done manually with Object.set_message_translation().
int text_direction = 0
int text_direction = 0Base text writing direction.
bool uppercase = false
bool uppercase = falseIf true, all the text displays as UPPERCASE.
int vertical_alignment = 1
int vertical_alignment = 1Controls the text's vertical alignment. Supports top, center, and bottom.
float width = 500.0
float width = 500.0Text width (in pixels), used for fill alignment.