Table of Contents

Class Label3D

A node for displaying plain text in 3D space.

Inheritance
Label3D

Remarks

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.

See Also

Properties

alpha_antialiasing_edge

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

var alpha_antialiasing_edge : float = 0.0

Property Value

float

Remarks

  • void set_alpha_antialiasing_edge(float value)
  • float get_alpha_antialiasing_edge

alpha_antialiasing_mode

The type of alpha antialiasing to apply. See AlphaAntiAliasing.

var alpha_antialiasing_mode : int = 0

Property Value

int

Remarks

  • void set_alpha_antialiasing(int value)
  • int get_alpha_antialiasing

alpha_cut

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

var alpha_cut : int = 0

Property Value

int

Remarks

  • void set_alpha_cut_mode(int value)
  • int get_alpha_cut_mode

alpha_hash_scale

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

var alpha_hash_scale : float = 1.0

Property Value

float

Remarks

  • void set_alpha_hash_scale(float value)
  • float get_alpha_hash_scale

alpha_scissor_threshold

Threshold at which the alpha scissor will discard values.

var alpha_scissor_threshold : float = 0.5

Property Value

float

Remarks

  • void set_alpha_scissor_threshold(float value)
  • float get_alpha_scissor_threshold

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.

var autowrap_mode : int = 0

Property Value

int

Remarks

  • void set_autowrap_mode(int value)
  • int get_autowrap_mode

billboard

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

var billboard : int = 0

Property Value

int

Remarks

  • void set_billboard_mode(int value)
  • int get_billboard_mode

double_sided

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

var double_sided : bool = true

Property Value

bool

Remarks

  • void set_draw_flag(int flag, bool enabled)
  • bool get_draw_flag(int flag)

fixed_size

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

var fixed_size : bool = false

Property Value

bool

Remarks

  • void set_draw_flag(int flag, bool enabled)
  • bool get_draw_flag(int flag)

font

Font configuration used to display text.

var font : Font

Property Value

Font

Remarks

  • void set_font(Font value)
  • Font get_font

font_size

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

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

var font_size : int = 32

Property Value

int

Remarks

  • void set_font_size(int value)
  • int get_font_size

horizontal_alignment

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

var horizontal_alignment : int = 1

Property Value

int

Remarks

  • void set_horizontal_alignment(int value)
  • int get_horizontal_alignment

justification_flags

Line fill alignment rules. See JustificationFlag for more information.

var justification_flags : int = 163

Property Value

int

Remarks

  • void set_justification_flags(int value)
  • int get_justification_flags

language

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

var language : String = ""

Property Value

String

Remarks

line_spacing

Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.

var line_spacing : float = 0.0

Property Value

float

Remarks

  • void set_line_spacing(float value)
  • float get_line_spacing

modulate

Text Color of the Label3D.

var modulate : Color = Color(1, 1, 1, 1)

Property Value

Color

Remarks

  • void set_modulate(Color value)
  • Color get_modulate

no_depth_test

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

var no_depth_test : bool = false

Property Value

bool

Remarks

  • void set_draw_flag(int flag, bool enabled)
  • bool get_draw_flag(int flag)

offset

The text drawing offset (in pixels).

var offset : Vector2 = Vector2(0, 0)

Property Value

Vector2

Remarks

outline_modulate

The tint of text outline.

var outline_modulate : Color = Color(0, 0, 0, 1)

Property Value

Color

Remarks

  • void set_outline_modulate(Color value)
  • Color get_outline_modulate

outline_render_priority

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 alpha_cut is set to Label3D.ALPHA_CUT_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).

var outline_render_priority : int = -1

Property Value

int

Remarks

  • void set_outline_render_priority(int value)
  • int get_outline_render_priority

outline_size

Text outline size.

var outline_size : int = 12

Property Value

int

Remarks

  • void set_outline_size(int value)
  • int get_outline_size

pixel_size

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 font_size while decreasing pixel_size at the same time.

var pixel_size : float = 0.005

Property Value

float

Remarks

  • void set_pixel_size(float value)
  • float get_pixel_size

render_priority

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

Note: This only applies if alpha_cut is set to Label3D.ALPHA_CUT_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).

var render_priority : int = 0

Property Value

int

Remarks

  • void set_render_priority(int value)
  • int get_render_priority

shaded

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

var shaded : bool = false

Property Value

bool

Remarks

  • void set_draw_flag(int flag, bool enabled)
  • bool get_draw_flag(int flag)

structured_text_bidi_override

Set BiDi algorithm override for the structured text.

var structured_text_bidi_override : int = 0

Property Value

int

Remarks

  • void set_structured_text_bidi_override(int value)
  • int get_structured_text_bidi_override

structured_text_bidi_override_options

Set additional options for BiDi override.

var structured_text_bidi_override_options : Array = []

Property Value

Array

Remarks

  • void set_structured_text_bidi_override_options(Array value)
  • Array get_structured_text_bidi_override_options

text

The text to display on screen.

var text : String = ""

Property Value

String

Remarks

text_direction

Base text writing direction.

var text_direction : int = 0

Property Value

int

Remarks

  • void set_text_direction(int value)
  • int get_text_direction

texture_filter

Filter flags for the texture. See TextureFilter for options.

var texture_filter : int = 3

Property Value

int

Remarks

  • void set_texture_filter(int value)
  • int get_texture_filter

uppercase

If true, all the text displays as UPPERCASE.

var uppercase : bool = false

Property Value

bool

Remarks

  • void set_uppercase(bool value)
  • bool is_uppercase

vertical_alignment

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

var vertical_alignment : int = 1

Property Value

int

Remarks

  • void set_vertical_alignment(int value)
  • int get_vertical_alignment

width

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

var width : float = 500.0

Property Value

float

Remarks

Methods

generate_triangle_mesh

Qualifiers: const

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

TriangleMesh generate_triangle_mesh

get_draw_flag(int)

Qualifiers: const

Returns the value of the specified flag.

bool get_draw_flag(int flag)

Parameters

flag int

set_draw_flag(int, bool)

If true, the specified flag will be enabled. See DrawFlags for a list of flags.

void set_draw_flag(int flag, bool enabled)

Parameters

flag int
enabled bool