Table of Contents

Class TextMesh

Namespace
Godot
Assembly
GodotSharp.dll

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.

public class TextMesh : PrimitiveMesh, IDisposable
Inheritance
TextMesh
Implements
Inherited Members

Constructors

TextMesh()

public TextMesh()

Properties

AutowrapMode

If set to something other than 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 TextServer.AutowrapMode.

public TextServer.AutowrapMode AutowrapMode { get; set; }

Property Value

TextServer.AutowrapMode

CurveStep

Step (in pixels) used to approximate Bézier curves.

public float CurveStep { get; set; }

Property Value

float

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.

public float Depth { get; set; }

Property Value

float

Font

Font configuration used to display text.

public Font Font { get; set; }

Property Value

Font

FontSize

Font size of the TextMesh's text.

public int FontSize { get; set; }

Property Value

int

HorizontalAlignment

Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the HorizontalAlignment constants.

public HorizontalAlignment HorizontalAlignment { get; set; }

Property Value

HorizontalAlignment

JustificationFlags

Line fill alignment rules. For more info see TextServer.JustificationFlag.

public TextServer.JustificationFlag JustificationFlags { get; set; }

Property Value

TextServer.JustificationFlag

Language

Language code used for text shaping algorithms, if left empty current locale is used instead.

public string Language { get; set; }

Property Value

string

LineSpacing

Vertical space between lines in multiline TextMesh.

public float LineSpacing { get; set; }

Property Value

float

Offset

The text drawing offset (in pixels).

public Vector2 Offset { get; set; }

Property Value

Vector2

PixelSize

The size of one pixel's width on the text to scale it in 3D.

public float PixelSize { get; set; }

Property Value

float

StructuredTextBidiOverride

Set BiDi algorithm override for the structured text.

public TextServer.StructuredTextParser StructuredTextBidiOverride { get; set; }

Property Value

TextServer.StructuredTextParser

StructuredTextBidiOverrideOptions

Set additional options for BiDi override.

public Array StructuredTextBidiOverrideOptions { get; set; }

Property Value

Array

Text

The text to generate mesh from.

public string Text { get; set; }

Property Value

string

TextDirection

Base text writing direction.

public TextServer.Direction TextDirection { get; set; }

Property Value

TextServer.Direction

Uppercase

If true, all the text displays as UPPERCASE.

public bool Uppercase { get; set; }

Property Value

bool

VerticalAlignment

Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the VerticalAlignment constants.

public VerticalAlignment VerticalAlignment { get; set; }

Property Value

VerticalAlignment

Width

Text width (in pixels), used for fill alignment.

public float Width { get; set; }

Property Value

float

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool