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
AlphaAntialiasingMode
The type of alpha antialiasing to apply. See BaseMaterial3D.AlphaAntiAliasing.
public BaseMaterial3D.AlphaAntiAliasing AlphaAntialiasingMode { get; set; }
Property Value
AlphaCut
The alpha cutting mode to use for the sprite. See Label3D.AlphaCutMode for possible values.
public Label3D.AlphaCutMode AlphaCut { get; set; }
Property Value
AlphaHashScale
The hashing scale for Alpha Hash. Recommended values between 0
and 2
.
public float AlphaHashScale { get; set; }
Property Value
AlphaScissorThreshold
Threshold at which the alpha scissor will discard values.
public float AlphaScissorThreshold { get; set; }
Property Value
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
Billboard
The billboard mode to use for the label. See BaseMaterial3D.BillboardModeEnum for possible values.
public BaseMaterial3D.BillboardModeEnum Billboard { get; set; }
Property Value
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
FixedSize
If true
, the label is rendered at the same size regardless of distance.
public bool FixedSize { get; set; }
Property Value
Font
Font configuration used to display text.
public Font Font { get; set; }
Property Value
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
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
JustificationFlags
Line fill alignment rules. For more info see TextServer.JustificationFlag.
public TextServer.JustificationFlag JustificationFlags { get; set; }
Property Value
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
LineSpacing
Vertical space between lines in multiline Label3D.
public float LineSpacing { get; set; }
Property Value
Modulate
public Color Modulate { get; set; }
Property Value
NoDepthTest
If true
, depth testing is disabled and the object will be drawn in render order.
public bool NoDepthTest { get; set; }
Property Value
Offset
The text drawing offset (in pixels).
public Vector2 Offset { get; set; }
Property Value
OutlineModulate
The tint of text outline.
public Color OutlineModulate { get; set; }
Property Value
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
OutlineSize
Text outline size.
public int OutlineSize { get; set; }
Property Value
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
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
Shaded
If true
, the Light3D in the Environment has effects on the label.
public bool Shaded { get; set; }
Property Value
StructuredTextBidiOverride
Set BiDi algorithm override for the structured text.
public TextServer.StructuredTextParser StructuredTextBidiOverride { get; set; }
Property Value
StructuredTextBidiOverrideOptions
Set additional options for BiDi override.
public Array StructuredTextBidiOverrideOptions { get; set; }
Property Value
Text
The text to display on screen.
public string Text { get; set; }
Property Value
TextDirection
Base text writing direction.
public TextServer.Direction TextDirection { get; set; }
Property Value
TextureFilter
Filter flags for the texture. See BaseMaterial3D.TextureFilterEnum for options.
public BaseMaterial3D.TextureFilterEnum TextureFilter { get; set; }
Property Value
Uppercase
If true
, all the text displays as UPPERCASE.
public bool Uppercase { get; set; }
Property Value
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
Width
Text width (in pixels), used for autowrap and fill alignment.
public float Width { get; set; }
Property Value
Methods
GenerateTriangleMesh()
Returns a TriangleMesh with the label's vertices following its current configuration (such as its PixelSize).
public TriangleMesh GenerateTriangleMesh()
Returns
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_nameName of the method to check for.
Returns
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_nameName of the signal to check for.
Returns
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_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.