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
Remarks
alpha_antialiasing_mode
The type of alpha antialiasing to apply. See AlphaAntiAliasing.
var alpha_antialiasing_mode : int = 0
Property Value
Remarks
alpha_cut
The alpha cutting mode to use for the sprite. See AlphaCutMode for possible values.
var alpha_cut : int = 0
Property Value
Remarks
alpha_hash_scale
The hashing scale for Alpha Hash. Recommended values between 0
and 2
.
var alpha_hash_scale : float = 1.0
Property Value
Remarks
alpha_scissor_threshold
Threshold at which the alpha scissor will discard values.
var alpha_scissor_threshold : float = 0.5
Property Value
Remarks
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
Remarks
billboard
The billboard mode to use for the label. See BillboardMode for possible values.
var billboard : int = 0
Property Value
Remarks
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
Remarks
fixed_size
If true
, the label is rendered at the same size regardless of distance.
var fixed_size : bool = false
Property Value
Remarks
font
Font configuration used to display text.
var font : Font
Property Value
Remarks
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
Remarks
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
Remarks
justification_flags
Line fill alignment rules. See JustificationFlag for more information.
var justification_flags : int = 163
Property Value
Remarks
language
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
var language : String = ""
Property Value
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
Remarks
modulate
Text Color of the Label3D.
var modulate : Color = Color(1, 1, 1, 1)
Property Value
Remarks
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
Remarks
offset
The text drawing offset (in pixels).
var offset : Vector2 = Vector2(0, 0)
Property Value
Remarks
outline_modulate
The tint of text outline.
var outline_modulate : Color = Color(0, 0, 0, 1)
Property Value
Remarks
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
Remarks
outline_size
Text outline size.
var outline_size : int = 12
Property Value
Remarks
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
Remarks
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
Remarks
shaded
If true
, the Light3D in the Environment has effects on the label.
var shaded : bool = false
Property Value
Remarks
structured_text_bidi_override
Set BiDi algorithm override for the structured text.
var structured_text_bidi_override : int = 0
Property Value
Remarks
structured_text_bidi_override_options
Set additional options for BiDi override.
var structured_text_bidi_override_options : Array = []
Property Value
Remarks
text
The text to display on screen.
var text : String = ""
Property Value
Remarks
text_direction
Base text writing direction.
var text_direction : int = 0
Property Value
Remarks
texture_filter
Filter flags for the texture. See TextureFilter for options.
var texture_filter : int = 3
Property Value
Remarks
uppercase
If true
, all the text displays as UPPERCASE.
var uppercase : bool = false
Property Value
Remarks
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
Remarks
width
Text width (in pixels), used for autowrap and fill alignment.
var width : float = 500.0
Property Value
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)