Table of Contents

Class Label3D

Namespace
Godot
Assembly
GodotSharp.dll

A node for displaying plain text in 3D space. By adjusting various properties of this node, you can configure things such as the text's appearance and whether it always faces the camera.

public class Label3D : GeometryInstance3D, IDisposable
Inheritance
Label3D
Implements
Inherited Members

Constructors

Label3D()

public Label3D()

Properties

AlphaAntialiasingEdge

Threshold at which antialiasing will be applied on the alpha channel.

public float AlphaAntialiasingEdge { get; set; }

Property Value

float

AlphaAntialiasingMode

The type of alpha antialiasing to apply. See BaseMaterial3D.AlphaAntiAliasing.

public BaseMaterial3D.AlphaAntiAliasing AlphaAntialiasingMode { get; set; }

Property Value

BaseMaterial3D.AlphaAntiAliasing

AlphaCut

The alpha cutting mode to use for the sprite. See Label3D.AlphaCutMode for possible values.

public Label3D.AlphaCutMode AlphaCut { get; set; }

Property Value

Label3D.AlphaCutMode

AlphaHashScale

The hashing scale for Alpha Hash. Recommended values between 0 and 2.

public float AlphaHashScale { get; set; }

Property Value

float

AlphaScissorThreshold

Threshold at which the alpha scissor will discard values.

public float AlphaScissorThreshold { get; set; }

Property Value

float

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

Billboard

The billboard mode to use for the label. See BaseMaterial3D.BillboardModeEnum for possible values.

public BaseMaterial3D.BillboardModeEnum Billboard { get; set; }

Property Value

BaseMaterial3D.BillboardModeEnum

DoubleSided

If true, text can be seen from the back as well, if false, it is invisible when looking at it from behind.

public bool DoubleSided { get; set; }

Property Value

bool

FixedSize

If true, the label is rendered at the same size regardless of distance.

public bool FixedSize { get; set; }

Property Value

bool

Font

Font configuration used to display text.

public Font Font { get; set; }

Property Value

Font

FontSize

Font size of the Label3D's text. To make the font look more detailed when up close, increase FontSize while decreasing PixelSize at the same time.

Higher font sizes require more time to render new characters, which can cause stuttering during gameplay.

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 line-breaking and 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 Label3D.

public float LineSpacing { get; set; }

Property Value

float

Modulate

Text Color of the Label3D.

public Color Modulate { get; set; }

Property Value

Color

NoDepthTest

If true, depth testing is disabled and the object will be drawn in render order.

public bool NoDepthTest { get; set; }

Property Value

bool

Offset

The text drawing offset (in pixels).

public Vector2 Offset { get; set; }

Property Value

Vector2

OutlineModulate

The tint of text outline.

public Color OutlineModulate { get; set; }

Property Value

Color

OutlineRenderPriority

Sets the render priority for the text outline. Higher priority objects will be sorted in front of lower priority objects.

Note: This only applies if AlphaCut is set to Disabled (default value).

Note: This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).

public int OutlineRenderPriority { get; set; }

Property Value

int

OutlineSize

Text outline size.

public int OutlineSize { get; set; }

Property Value

int

PixelSize

The size of one pixel's width on the label to scale it in 3D. To make the font look more detailed when up close, increase FontSize while decreasing PixelSize at the same time.

public float PixelSize { get; set; }

Property Value

float

RenderPriority

Sets the render priority for the text. Higher priority objects will be sorted in front of lower priority objects.

Note: This only applies if AlphaCut is set to Disabled (default value).

Note: This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).

public int RenderPriority { get; set; }

Property Value

int

Shaded

If true, the Light3D in the Environment has effects on the label.

public bool Shaded { get; set; }

Property Value

bool

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 display on screen.

public string Text { get; set; }

Property Value

string

TextDirection

Base text writing direction.

public TextServer.Direction TextDirection { get; set; }

Property Value

TextServer.Direction

TextureFilter

Filter flags for the texture. See BaseMaterial3D.TextureFilterEnum for options.

public BaseMaterial3D.TextureFilterEnum TextureFilter { get; set; }

Property Value

BaseMaterial3D.TextureFilterEnum

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 autowrap and fill alignment.

public float Width { get; set; }

Property Value

float

Methods

GenerateTriangleMesh()

Returns a TriangleMesh with the label's vertices following its current configuration (such as its PixelSize).

public TriangleMesh GenerateTriangleMesh()

Returns

TriangleMesh

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