A node for displaying plain text in 3D space.
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.
$DOCS_URL/tutorials/3d/3d_text.html
Returns a [TriangleMesh] with the label's vertices following its current configuration (such as its [member pixel_size]).
Returns the value of the specified flag.
If [code]true[/code], the specified [param flag] will be enabled.
- Threshold at which antialiasing will be applied on the alpha channel.
- The type of alpha antialiasing to apply.
- The alpha cutting mode to use for the sprite.
- The hashing scale for Alpha Hash. Recommended values between [code]0[/code] and [code]2[/code].
- Threshold at which the alpha scissor will discard values.
- 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.
- Autowrap space trimming flags. See [constant TextServer.BREAK_TRIM_START_EDGE_SPACES] and [constant TextServer.BREAK_TRIM_END_EDGE_SPACES] for more info.
- The billboard mode to use for the label.
- 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.
- If [code]true[/code], the label is rendered at the same size regardless of distance. The label's size on screen is the same as if the camera was [code]1.0[/code] units away from the label's origin, regardless of the actual distance from the camera. The [Camera3D]'s field of view (or [member Camera3D.size] when in orthogonal/frustum mode) still affects the size the label is drawn at.
- Font configuration used to display text.
- 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.
- Controls the text's horizontal alignment. Supports left, center, right, and fill (also known as justify).
- Line fill alignment rules.
- Language code used for line-breaking and text shaping algorithms. If left empty, the current locale is used instead.
- Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
- Text [Color] of the [Label3D].
- If [code]true[/code], depth testing is disabled and the object will be drawn in render order.
- The text drawing offset (in pixels).
- The tint of text outline.
- Sets the render priority for the text outline. Higher priority objects will be sorted in front of lower priority objects. [b]Note:[/b] This only applies if [member alpha_cut] is set to [constant ALPHA_CUT_DISABLED] (default value). [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).
- Text outline 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 [member font_size] while decreasing [member pixel_size] at the same time.
- Sets the render priority for the text. Higher priority objects will be sorted in front of lower priority objects. [b]Note:[/b] This only applies if [member alpha_cut] is set to [constant ALPHA_CUT_DISABLED] (default value). [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).
- If [code]true[/code], the [Light3D] in the [Environment] has effects on the label.
- Set BiDi algorithm override for the structured text.
- Set additional options for BiDi override.
- The text to display on screen.
- Base text writing direction.
- Filter flags for the texture.
- If [code]true[/code], all the text displays as UPPERCASE.
- Controls the text's vertical alignment. Supports top, center, and bottom.
- Text width (in pixels), used for autowrap and fill alignment.
If set, lights in the environment affect the label.
If set, text can be seen from the back as well. If not, the text is invisible when looking at it from behind.
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.
Label is scaled by depth so that it always appears the same size on screen.
Represents the size of the [enum DrawFlags] enum.
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.
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.
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.
This mode draws cuts off all values below a spatially-deterministic threshold, the rest will remain opaque.