2022-04-19 12:27:18 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-03-01 01:44:37 +01:00
<class name= "Label3D" inherits= "GeometryInstance3D" version= "4.1" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2022-04-19 12:27:18 +02:00
<brief_description >
2023-04-30 16:26:09 +02:00
A node for displaying plain text in 3D space.
2022-04-19 12:27:18 +02:00
</brief_description>
<description >
2023-04-30 16:26:09 +02:00
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.
2022-04-19 12:27:18 +02:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "generate_triangle_mesh" qualifiers= "const" >
<return type= "TriangleMesh" />
<description >
Returns a [TriangleMesh] with the label's vertices following its current configuration (such as its [member pixel_size]).
</description>
</method>
<method name= "get_draw_flag" qualifiers= "const" >
<return type= "bool" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "flag" type= "int" enum= "Label3D.DrawFlags" />
2022-04-19 12:27:18 +02:00
<description >
Returns the value of the specified flag.
</description>
</method>
<method name= "set_draw_flag" >
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "flag" type= "int" enum= "Label3D.DrawFlags" />
<param index= "1" name= "enabled" type= "bool" />
2022-04-19 12:27:18 +02:00
<description >
If [code]true[/code], the specified flag will be enabled. See [enum Label3D.DrawFlags] for a list of flags.
</description>
</method>
</methods>
<members >
2023-01-31 09:40:08 +01:00
<member name= "alpha_antialiasing_edge" type= "float" setter= "set_alpha_antialiasing_edge" getter= "get_alpha_antialiasing_edge" default= "0.0" >
Threshold at which antialiasing will be applied on the alpha channel.
</member>
<member name= "alpha_antialiasing_mode" type= "int" setter= "set_alpha_antialiasing" getter= "get_alpha_antialiasing" enum= "BaseMaterial3D.AlphaAntiAliasing" default= "0" >
The type of alpha antialiasing to apply. See [enum BaseMaterial3D.AlphaAntiAliasing].
</member>
2022-04-19 12:27:18 +02:00
<member name= "alpha_cut" type= "int" setter= "set_alpha_cut_mode" getter= "get_alpha_cut_mode" enum= "Label3D.AlphaCutMode" default= "0" >
The alpha cutting mode to use for the sprite. See [enum AlphaCutMode] for possible values.
</member>
2023-01-24 11:24:53 +01:00
<member name= "alpha_hash_scale" type= "float" setter= "set_alpha_hash_scale" getter= "get_alpha_hash_scale" default= "1.0" >
The hashing scale for Alpha Hash. Recommended values between [code]0[/code] and [code]2[/code].
</member>
2022-04-19 12:27:18 +02:00
<member name= "alpha_scissor_threshold" type= "float" setter= "set_alpha_scissor_threshold" getter= "get_alpha_scissor_threshold" default= "0.5" >
Threshold at which the alpha scissor will discard values.
</member>
2022-06-15 10:01:45 +02:00
<member name= "autowrap_mode" type= "int" setter= "set_autowrap_mode" getter= "get_autowrap_mode" enum= "TextServer.AutowrapMode" default= "0" >
If set to something other than [constant 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 [enum TextServer.AutowrapMode].
2022-04-19 12:27:18 +02:00
</member>
<member name= "billboard" type= "int" setter= "set_billboard_mode" getter= "get_billboard_mode" enum= "BaseMaterial3D.BillboardMode" default= "0" >
The billboard mode to use for the label. See [enum BaseMaterial3D.BillboardMode] for possible values.
</member>
2022-11-06 20:27:24 +01:00
<member name= "cast_shadow" type= "int" setter= "set_cast_shadows_setting" getter= "get_cast_shadows_setting" overrides= "GeometryInstance3D" enum= "GeometryInstance3D.ShadowCastingSetting" default= "0" />
2022-04-19 12:27:18 +02:00
<member name= "double_sided" type= "bool" setter= "set_draw_flag" getter= "get_draw_flag" default= "true" >
If [code]true[/code], text can be seen from the back as well, if [code]false[/code], it is invisible when looking at it from behind.
</member>
<member name= "fixed_size" type= "bool" setter= "set_draw_flag" getter= "get_draw_flag" default= "false" >
If [code]true[/code], the label is rendered at the same size regardless of distance.
</member>
<member name= "font" type= "Font" setter= "set_font" getter= "get_font" >
2022-05-09 11:47:10 +02:00
Font configuration used to display text.
2022-04-19 12:27:18 +02:00
</member>
2022-08-09 16:26:28 +02:00
<member name= "font_size" type= "int" setter= "set_font_size" getter= "get_font_size" default= "32" >
2022-08-15 18:21:13 +02:00
Font size of the [Label3D]'s text. To make the font look more detailed when up close, increase [member font_size] while decreasing [member pixel_size] at the same time.
Higher font sizes require more time to render new characters, which can cause stuttering during gameplay.
2022-04-19 12:27:18 +02:00
</member>
2022-11-06 20:27:24 +01:00
<member name= "gi_mode" type= "int" setter= "set_gi_mode" getter= "get_gi_mode" overrides= "GeometryInstance3D" enum= "GeometryInstance3D.GIMode" default= "0" />
2022-04-19 12:27:18 +02:00
<member name= "horizontal_alignment" type= "int" setter= "set_horizontal_alignment" getter= "get_horizontal_alignment" enum= "HorizontalAlignment" default= "1" >
2022-04-25 12:14:30 +02:00
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
2022-04-19 12:27:18 +02:00
</member>
2023-06-15 16:06:22 +02:00
<member name= "justification_flags" type= "int" setter= "set_justification_flags" getter= "get_justification_flags" enum= "TextServer.JustificationFlag" is_bitfield= "true" default= "163" >
2023-03-23 10:22:37 +01:00
Line fill alignment rules. For more info see [enum TextServer.JustificationFlag].
</member>
2022-04-19 12:27:18 +02:00
<member name= "language" type= "String" setter= "set_language" getter= "get_language" default= """" >
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
</member>
<member name= "line_spacing" type= "float" setter= "set_line_spacing" getter= "get_line_spacing" default= "0.0" >
Vertical space between lines in multiline [Label3D].
</member>
<member name= "modulate" type= "Color" setter= "set_modulate" getter= "get_modulate" default= "Color(1, 1, 1, 1)" >
Text [Color] of the [Label3D].
</member>
<member name= "no_depth_test" type= "bool" setter= "set_draw_flag" getter= "get_draw_flag" default= "false" >
If [code]true[/code], depth testing is disabled and the object will be drawn in render order.
</member>
2022-04-28 20:23:15 +02:00
<member name= "offset" type= "Vector2" setter= "set_offset" getter= "get_offset" default= "Vector2(0, 0)" >
The text drawing offset (in pixels).
</member>
2022-04-19 12:27:18 +02:00
<member name= "outline_modulate" type= "Color" setter= "set_outline_modulate" getter= "get_outline_modulate" default= "Color(0, 0, 0, 1)" >
2022-05-09 11:47:10 +02:00
The tint of text outline.
2022-04-19 12:27:18 +02:00
</member>
2022-04-30 10:41:50 +02:00
<member name= "outline_render_priority" type= "int" setter= "set_outline_render_priority" getter= "get_outline_render_priority" default= "-1" >
Sets the render priority for the text outline. Higher priority objects will be sorted in front of lower priority objects.
2022-07-27 15:55:38 +02:00
[b]Note:[/b] This only applies if [member alpha_cut] is set to [constant ALPHA_CUT_DISABLED] (default value).
2022-04-30 10:41:50 +02:00
[b]Note:[/b] 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).
</member>
2022-08-09 16:26:28 +02:00
<member name= "outline_size" type= "int" setter= "set_outline_size" getter= "get_outline_size" default= "12" >
2022-04-19 12:27:18 +02:00
Text outline size.
</member>
2022-08-09 16:26:28 +02:00
<member name= "pixel_size" type= "float" setter= "set_pixel_size" getter= "get_pixel_size" default= "0.005" >
2022-08-15 18:21:13 +02:00
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 [member font_size] while decreasing [member pixel_size] at the same time.
2022-04-19 12:27:18 +02:00
</member>
2022-04-30 10:41:50 +02:00
<member name= "render_priority" type= "int" setter= "set_render_priority" getter= "get_render_priority" default= "0" >
Sets the render priority for the text. Higher priority objects will be sorted in front of lower priority objects.
2022-07-27 15:55:38 +02:00
[b]Note:[/b] This only applies if [member alpha_cut] is set to [constant ALPHA_CUT_DISABLED] (default value).
2022-04-30 10:41:50 +02:00
[b]Note:[/b] 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).
</member>
2022-04-19 12:27:18 +02:00
<member name= "shaded" type= "bool" setter= "set_draw_flag" getter= "get_draw_flag" default= "false" >
If [code]true[/code], the [Light3D] in the [Environment] has effects on the label.
</member>
<member name= "structured_text_bidi_override" type= "int" setter= "set_structured_text_bidi_override" getter= "get_structured_text_bidi_override" enum= "TextServer.StructuredTextParser" default= "0" >
Set BiDi algorithm override for the structured text.
</member>
<member name= "structured_text_bidi_override_options" type= "Array" setter= "set_structured_text_bidi_override_options" getter= "get_structured_text_bidi_override_options" default= "[]" >
Set additional options for BiDi override.
</member>
<member name= "text" type= "String" setter= "set_text" getter= "get_text" default= """" >
The text to display on screen.
</member>
<member name= "text_direction" type= "int" setter= "set_text_direction" getter= "get_text_direction" enum= "TextServer.Direction" default= "0" >
Base text writing direction.
</member>
<member name= "texture_filter" type= "int" setter= "set_texture_filter" getter= "get_texture_filter" enum= "BaseMaterial3D.TextureFilter" default= "3" >
Filter flags for the texture. See [enum BaseMaterial3D.TextureFilter] for options.
</member>
<member name= "uppercase" type= "bool" setter= "set_uppercase" getter= "is_uppercase" default= "false" >
If [code]true[/code], all the text displays as UPPERCASE.
</member>
<member name= "vertical_alignment" type= "int" setter= "set_vertical_alignment" getter= "get_vertical_alignment" enum= "VerticalAlignment" default= "1" >
Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the [enum VerticalAlignment] constants.
</member>
<member name= "width" type= "float" setter= "set_width" getter= "get_width" default= "500.0" >
Text width (in pixels), used for autowrap and fill alignment.
</member>
</members>
<constants >
<constant name= "FLAG_SHADED" value= "0" enum= "DrawFlags" >
If set, lights in the environment affect the label.
</constant>
<constant name= "FLAG_DOUBLE_SIDED" value= "1" enum= "DrawFlags" >
2022-07-27 15:55:38 +02:00
If set, text can be seen from the back as well. If not, the text is invisible when looking at it from behind.
2022-04-19 12:27:18 +02:00
</constant>
<constant name= "FLAG_DISABLE_DEPTH_TEST" value= "2" enum= "DrawFlags" >
Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it.
</constant>
<constant name= "FLAG_FIXED_SIZE" value= "3" enum= "DrawFlags" >
Label is scaled by depth so that it always appears the same size on screen.
</constant>
<constant name= "FLAG_MAX" value= "4" enum= "DrawFlags" >
Represents the size of the [enum DrawFlags] enum.
</constant>
<constant name= "ALPHA_CUT_DISABLED" value= "0" enum= "AlphaCutMode" >
2022-08-15 18:21:13 +02:00
This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping. [member GeometryInstance3D.cast_shadow] has no effect when this transparency mode is used; the [Label3D] will never cast shadows.
2022-04-19 12:27:18 +02:00
</constant>
<constant name= "ALPHA_CUT_DISCARD" value= "1" enum= "AlphaCutMode" >
This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see [member ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa]). This mode is also known as [i]alpha testing[/i] or [i]1-bit transparency[/i].
[b]Note:[/b] This mode might have issues with anti-aliased fonts and outlines, try adjusting [member alpha_scissor_threshold] or using MSDF font.
[b]Note:[/b] When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline.
</constant>
<constant name= "ALPHA_CUT_OPAQUE_PREPASS" value= "2" enum= "AlphaCutMode" >
This mode draws fully opaque pixels in the depth prepass. This is slower than [constant ALPHA_CUT_DISABLED] or [constant ALPHA_CUT_DISCARD], but it allows displaying translucent areas and smooth edges while using proper sorting.
[b]Note:[/b] When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline.
</constant>
2023-01-24 11:24:53 +01:00
<constant name= "ALPHA_CUT_HASH" value= "3" enum= "AlphaCutMode" >
This mode draws cuts off all values below a spatially-deterministic threshold, the rest will remain opaque.
</constant>
2022-04-19 12:27:18 +02:00
</constants>
</class>