Class TextMesh
Generate an PrimitiveMesh from the text.
- Inheritance
-
TextMesh
Remarks
Generate an 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.
See Also
Properties
autowrap_mode
If 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. To see how each mode behaves, see AutowrapMode.
var autowrap_mode : int = 0
Property Value
Remarks
curve_step
Step (in pixels) used to approximate Bézier curves.
var curve_step : float = 0.5
Property Value
Remarks
depth
Depths 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.
var depth : float = 0.05
Property Value
Remarks
font
Font configuration used to display text.
var font : Font
Property Value
Remarks
font_size
Font size of the TextMesh's text.
var font_size : int = 16
Property Value
Remarks
horizontal_alignment
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the HorizontalAlignment constants.
var horizontal_alignment : int = 1
Property Value
Remarks
justification_flags
Line fill alignment rules. See JustificationFlag for more information.
var justification_flags : int = 163
Property Value
Remarks
language
Language code used for text shaping algorithms, if left empty current locale is used instead.
var language : String = ""
Property Value
Remarks
line_spacing
Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
var line_spacing : float = 0.0
Property Value
Remarks
offset
The text drawing offset (in pixels).
var offset : Vector2 = Vector2(0, 0)
Property Value
Remarks
pixel_size
The size of one pixel's width on the text to scale it in 3D.
var pixel_size : float = 0.01
Property Value
Remarks
structured_text_bidi_override
Set BiDi algorithm override for the structured text.
var structured_text_bidi_override : int = 0
Property Value
Remarks
structured_text_bidi_override_options
Set additional options for BiDi override.
var structured_text_bidi_override_options : Array = []
Property Value
Remarks
text
The text to generate mesh from.
Note: Due to being a Resource, it doesn't follow the rules of auto_translate_mode. If disabling translation is desired, it should be done manually with Object.set_message_translation.
var text : String = ""
Property Value
Remarks
text_direction
Base text writing direction.
var text_direction : int = 0
Property Value
Remarks
uppercase
If true
, all the text displays as UPPERCASE.
var uppercase : bool = false
Property Value
Remarks
vertical_alignment
Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the VerticalAlignment constants.
var vertical_alignment : int = 1
Property Value
Remarks
width
Text width (in pixels), used for fill alignment.
var width : float = 500.0