TextMesh
Generate a PrimitiveMesh from the text.
Generate a PrimitiveMesh from the text.
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.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
TextMeshConstructor
public TextMesh();Properties18
AutowrapModeProperty
public TextServer.AutowrapMode AutowrapMode { get; set; }If set to something other than TextServer.AutowrapMode.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.
CurveStepProperty
public float CurveStep { get; set; }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.
DepthProperty
public float Depth { get; set; }Glyph extrusion depth in mesh units, extending to both sides of the text plane. Not a shadow, collider or Label3D thickness. Assign TextMesh to a MeshInstance3D and create physics separately if needed.
FontProperty
public Font Font { get; set; }Font configuration used to display text.
FontSizeProperty
public int FontSize { get; set; }Font size of the TextMesh's text. This property works in tandem with TextMesh.PixelSize. Higher values will result in a more detailed font, regardless of TextMesh.CurveStep and TextMesh.PixelSize. Consider keeping this value below 63 (inclusive) for good performance, and adjust TextMesh.PixelSize 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 Entity3D.Scale instead.
HorizontalAlignmentProperty
public HorizontalAlignment HorizontalAlignment { get; set; }Controls the text's horizontal alignment. Supports left, center, right, and fill (also known as justify).
JustificationFlagsProperty
public TextServer.JustificationFlag JustificationFlags { get; set; }Line fill alignment rules.
LanguageProperty
public string Language { get; set; }Language code used for line-breaking and text shaping algorithms. If left empty, the current locale is used instead.
LineSpacingProperty
public float LineSpacing { get; set; }Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
OffsetProperty
public Vector2 Offset { get; set; }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 Entity3D.Position instead.
PixelSizeProperty
public float PixelSize { get; set; }Font-pixel scale in mesh units. Combines with FontSize for glyph width and height; Depth controls thickness separately. Screen size also depends on transforms and the camera.
StructuredTextBidiOverrideProperty
public TextServer.StructuredTextParser StructuredTextBidiOverride { get; set; }Set BiDi algorithm override for the structured text.
StructuredTextBidiOverrideOptionsProperty
public Reckfell.Collections.Array StructuredTextBidiOverrideOptions { get; set; }Set additional options for BiDi override.
TextProperty
public string Text { get; set; }The text to generate mesh from.
Note: Due to being a Resource, it doesn't follow the rules of Entity.AutoTranslateMode. If disabling translation is desired, it should be done manually with ReckfellObject.SetMessageTranslation.
TextDirectionProperty
public TextServer.Direction TextDirection { get; set; }Base text writing direction.
UppercaseProperty
public bool Uppercase { get; set; }If true, all the text displays as UPPERCASE.
VerticalAlignmentProperty
public VerticalAlignment VerticalAlignment { get; set; }Controls the text's vertical alignment. Supports top, center, and bottom.
WidthProperty
public float Width { get; set; }Text width (in pixels), used for fill alignment.
Methods36
GetAutowrapModeTextServer.AutowrapMode
public TextServer.AutowrapMode GetAutowrapMode();TextServer.AutowrapModeGetCurveStepfloat
public float GetCurveStep();floatGetDepthfloat
public float GetDepth();floatGetFontFont
public Font GetFont();FontGetFontSizeint
public int GetFontSize();intGetHorizontalAlignmentHorizontalAlignment
public HorizontalAlignment GetHorizontalAlignment();HorizontalAlignmentGetJustificationFlagsTextServer.JustificationFlag
public TextServer.JustificationFlag GetJustificationFlags();TextServer.JustificationFlagGetLanguagestring
public string GetLanguage();stringGetLineSpacingfloat
public float GetLineSpacing();floatGetOffsetVector2
public Vector2 GetOffset();Vector2GetPixelSizefloat
public float GetPixelSize();floatGetStructuredTextBidiOverrideTextServer.StructuredTextParser
public TextServer.StructuredTextParser GetStructuredTextBidiOverride();TextServer.StructuredTextParserGetStructuredTextBidiOverrideOptionsReckfell.Collections.Array
public Reckfell.Collections.Array GetStructuredTextBidiOverrideOptions();Reckfell.Collections.ArrayGetTextstring
public string GetText();stringGetTextDirectionTextServer.Direction
public TextServer.Direction GetTextDirection();TextServer.DirectionGetVerticalAlignmentVerticalAlignment
public VerticalAlignment GetVerticalAlignment();VerticalAlignmentGetWidthfloat
public float GetWidth();floatIsUppercasebool
public bool IsUppercase();boolSetAutowrapModevoid
public void SetAutowrapMode(TextServer.AutowrapMode autowrapMode);| Name | Type | Default |
|---|---|---|
autowrapMode | TextServer.AutowrapMode | — |
SetCurveStepvoid
public void SetCurveStep(float curveStep);| Name | Type | Default |
|---|---|---|
curveStep | float | — |
SetDepthvoid
public void SetDepth(float depth);| Name | Type | Default |
|---|---|---|
depth | float | — |
SetFontvoid
public void SetFont(Font font);| Name | Type | Default |
|---|---|---|
font | Font | — |
SetFontSizevoid
public void SetFontSize(int fontSize);| Name | Type | Default |
|---|---|---|
fontSize | int | — |
SetHorizontalAlignmentvoid
public void SetHorizontalAlignment(HorizontalAlignment alignment);| Name | Type | Default |
|---|---|---|
alignment | HorizontalAlignment | — |
SetJustificationFlagsvoid
public void SetJustificationFlags(TextServer.JustificationFlag justificationFlags);| Name | Type | Default |
|---|---|---|
justificationFlags | TextServer.JustificationFlag | — |
SetLanguagevoid
public void SetLanguage(string language);| Name | Type | Default |
|---|---|---|
language | string | — |
SetLineSpacingvoid
public void SetLineSpacing(float lineSpacing);| Name | Type | Default |
|---|---|---|
lineSpacing | float | — |
SetOffsetvoid
public void SetOffset(Vector2 offset);| Name | Type | Default |
|---|---|---|
offset | Vector2 | — |
SetPixelSizevoid
public void SetPixelSize(float pixelSize);| Name | Type | Default |
|---|---|---|
pixelSize | float | — |
SetStructuredTextBidiOverridevoid
public void SetStructuredTextBidiOverride(TextServer.StructuredTextParser parser);| Name | Type | Default |
|---|---|---|
parser | TextServer.StructuredTextParser | — |
SetStructuredTextBidiOverrideOptionsvoid
public void SetStructuredTextBidiOverrideOptions(Reckfell.Collections.Array args);| Name | Type | Default |
|---|---|---|
args | Reckfell.Collections.Array | — |
SetTextvoid
public void SetText(string text);| Name | Type | Default |
|---|---|---|
text | string | — |
SetTextDirectionvoid
public void SetTextDirection(TextServer.Direction direction);| Name | Type | Default |
|---|---|---|
direction | TextServer.Direction | — |
SetUppercasevoid
public void SetUppercase(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetVerticalAlignmentvoid
public void SetVerticalAlignment(VerticalAlignment alignment);| Name | Type | Default |
|---|---|---|
alignment | VerticalAlignment | — |
SetWidthvoid
public void SetWidth(float width);| Name | Type | Default |
|---|---|---|
width | float | — |