TextMesh
继承: PrimitiveMesh
< Mesh
< Resource
< RefCounted
< Object
Generate an PrimitiveMesh
from the text.
描述
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.
属性
属性说明
AutowrapMode autowrap_mode = 0
void
set_autowrap_mode ( value: AutowrapMode )- AutowrapMode get_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.
float
curve_step = 0.5
Step (in pixels) used to approximate Bézier curves.
float
depth = 0.05
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.
Font
font
Font configuration used to display text.
int
font_size = 16
Font size of the TextMesh's text.
HorizontalAlignment horizontal_alignment = 1
void
set_horizontal_alignment ( value: HorizontalAlignment )- HorizontalAlignment get_horizontal_alignment ( )
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the HorizontalAlignment constants.
JustificationFlag justification_flags = 163
void
set_justification_flags ( value: JustificationFlag )- JustificationFlag get_justification_flags ( )
Line fill alignment rules. See JustificationFlag for more information.
String
language = ""
Language code used for text shaping algorithms, if left empty current locale is used instead.
float
line_spacing = 0.0
Vertical space between lines in multiline TextMesh.
Vector2
offset = Vector2(0, 0)
The text drawing offset (in pixels).
float
pixel_size = 0.01
The size of one pixel's width on the text to scale it in 3D.
StructuredTextParser structured_text_bidi_override = 0
void
set_structured_text_bidi_override ( value: StructuredTextParser )- StructuredTextParser get_structured_text_bidi_override ( )
Set BiDi algorithm override for the structured text.
Array
structured_text_bidi_override_options = []
void
set_structured_text_bidi_override_options ( value:Array
)Array
get_structured_text_bidi_override_options ( )
Set additional options for BiDi override.
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
.
Direction text_direction = 0
Base text writing direction.
bool
uppercase = false
If true
, all the text displays as UPPERCASE.
VerticalAlignment vertical_alignment = 1
void
set_vertical_alignment ( value: VerticalAlignment )- VerticalAlignment get_vertical_alignment ( )
Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the VerticalAlignment constants.
float
width = 500.0
Text width (in pixels), used for fill alignment.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。