Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AnimationMixer (2)
- AudioStreamPlayer
- CanvasItem (2)
- CanvasLayer (1)
- EditorFileSystem
- EditorPlugin (1)
- EditorResourcePreview
- HTTPRequest
- InstancePlaceholder
- MissingNode
- MultiplayerSpawner
- MultiplayerSynchronizer
- NavigationAgent2D
- NavigationAgent3D
- Node3D (31)
- ResourcePreloader
- ShaderGlobalsOverride
- StatusIndicator
- Timer
- Viewport (2)
- WorldEnvironment
- AudioListener3D
- AudioStreamPlayer3D
- BoneAttachment3D
- Camera3D (1)
- CollisionObject3D (2)
- CollisionPolygon3D
- CollisionShape3D
- GridMap
- ImporterMeshInstance3D
- Joint3D (5)
- LightmapProbe
- Marker3D
- NavigationLink3D
- NavigationObstacle3D
- NavigationRegion3D
- OpenXRCompositionLayer (3)
- OpenXRHand
- Path3D
- PathFollow3D
- RayCast3D
- RemoteTransform3D
- ShapeCast3D
- Skeleton3D
- SkeletonModifier3D (7)
- SpringArm3D
- SpringBoneCollision3D (3)
- VehicleWheel3D
- VisualInstance3D (13)
- XRFaceModifier3D
- XRNode3D (2)
- XROrigin3D
- Decal
- FogVolume
- GPUParticlesAttractor3D (3)
- GPUParticlesCollision3D (4)
- GeometryInstance3D (7)
- Light3D (3)
- LightmapGI
- OccluderInstance3D
- OpenXRVisibilityMask
- ReflectionProbe
- RootMotionView
- VisibleOnScreenNotifier3D (1)
- VoxelGI
- CPUParticles3D
- CSGShape3D (2)
- GPUParticles3D
- Label3D
- MeshInstance3D (1)
- MultiMeshInstance3D
- SpriteBase3D (2)
Table of contents
-
var alpha_antialiasing_edge: float = 0.0 -
var alpha_antialiasing_mode = ALPHA_ANTIALIASING_OFF -
var alpha_cut = ALPHA_CUT_DISABLED -
var alpha_hash_scale: float = 1.0 -
var alpha_scissor_threshold: float = 0.5 -
var autowrap_mode = AUTOWRAP_OFF -
var billboard = BILLBOARD_DISABLED -
var cast_shadow = SHADOW_CASTING_SETTING_OFF -
var double_sided: bool = true -
var fixed_size: bool = false -
var font: Font -
var font_size: int = 32 -
var gi_mode = GI_MODE_DISABLED -
var horizontal_alignment: int = 1 -
var justification_flags: int = 163 -
var language: String = "" -
var line_spacing: float = 0.0 -
var modulate: Color = Color(1, 1, 1, 1) -
var no_depth_test: bool = false -
var offset: Vector2 = Vector2(0, 0) -
var outline_modulate: Color = Color(0, 0, 0, 1) -
var outline_render_priority: int = -1 -
var outline_size: int = 12 -
var pixel_size: float = 0.005 -
var render_priority: int = 0 -
var shaded: bool = false -
var structured_text_bidi_override = STRUCTURED_TEXT_DEFAULT -
var structured_text_bidi_override_options: Array = [] -
var text: String = "" -
var text_direction = DIRECTION_AUTO -
var texture_filter = TEXTURE_FILTER_LINEAR_WITH_MIPMAPS -
var uppercase: bool = false -
var vertical_alignment: int = 1 -
var width: float = 500.0 -
const func generate_triangle_mesh() -> TriangleMesh -
const func get_draw_flag(flag: int enumLabel3D.DrawFlags) -> bool -
func set_draw_flag(enabled: bool) -> void -
const FLAG_SHADED = 0 enum DrawFlags -
const FLAG_DOUBLE_SIDED = 1 enum DrawFlags -
const FLAG_DISABLE_DEPTH_TEST = 2 enum DrawFlags -
const FLAG_FIXED_SIZE = 3 enum DrawFlags -
const FLAG_MAX = 4 enum DrawFlags -
const ALPHA_CUT_DISABLED = 0 enum AlphaCutMode -
const ALPHA_CUT_DISCARD = 1 enum AlphaCutMode -
const ALPHA_CUT_OPAQUE_PREPASS = 2 enum AlphaCutMode -
const ALPHA_CUT_HASH = 3 enum AlphaCutMode -
enum DrawFlags -
enum AlphaCutMode
Label3D #
is_instantiable, Node3D, Node, core, not_builtin_classes
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.
Members #
var alpha_antialiasing_edge: float = 0.0#
Threshold at which antialiasing will be applied on the alpha channel.
var alpha_antialiasing_mode = ALPHA_ANTIALIASING_OFF#
The type of alpha antialiasing to apply. See BaseMaterial3D.AlphaAntiAliasing.
var alpha_cut = ALPHA_CUT_DISABLED#
The alpha cutting mode to use for the sprite. See AlphaCutMode for possible values.
var alpha_hash_scale: float = 1.0#
The hashing scale for Alpha Hash. Recommended values between 0 and 2.
var alpha_scissor_threshold: float = 0.5#
Threshold at which the alpha scissor will discard values.
var autowrap_mode = AUTOWRAP_OFF#
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 TextServer.AutowrapMode.
var billboard = BILLBOARD_DISABLED#
The billboard mode to use for the label. See BaseMaterial3D.BillboardMode for possible values.
var cast_shadow = SHADOW_CASTING_SETTING_OFF#
var double_sided: bool = true#
If true, text can be seen from the back as well, if false, it is invisible when looking at it from behind.
var fixed_size: bool = false#
If true, the label is rendered at the same size regardless of distance.
var font: Font#
Font configuration used to display text.
var font_size: int = 32#
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 gi_mode = GI_MODE_DISABLED#
var horizontal_alignment: int = 1#
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the HorizontalAlignment constants.
var justification_flags: int = 163#
Line fill alignment rules. See TextServer.JustificationFlag for more information.
var language: String = ""#
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
var line_spacing: float = 0.0#
Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
var modulate: Color = Color(1, 1, 1, 1)#
var no_depth_test: bool = false#
If true, depth testing is disabled and the object will be drawn in render order.
var offset: Vector2 = Vector2(0, 0)#
The text drawing offset (in pixels).
var outline_modulate: Color = Color(0, 0, 0, 1)#
The tint of text outline.
var outline_render_priority: int = -1#
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 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_size: int = 12#
Text outline size.
var pixel_size: float = 0.005#
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 render_priority: int = 0#
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 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 shaded: bool = false#
If true, the Light3D in the Environment has effects on the label.
var structured_text_bidi_override = STRUCTURED_TEXT_DEFAULT#
Set BiDi algorithm override for the structured text.
var structured_text_bidi_override_options: Array = []#
Set additional options for BiDi override.
var text: String = ""#
The text to display on screen.
var text_direction = DIRECTION_AUTO#
Base text writing direction.
var texture_filter = TEXTURE_FILTER_LINEAR_WITH_MIPMAPS#
Filter flags for the texture. See BaseMaterial3D.TextureFilter for options.
var uppercase: bool = false#
If true, all the text displays as UPPERCASE.
var vertical_alignment: int = 1#
Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the VerticalAlignment constants.
var width: float = 500.0#
Text width (in pixels), used for autowrap and fill alignment.
Methods #
const func generate_triangle_mesh() -> TriangleMesh#
Returns a TriangleMesh with the label's vertices following its current configuration (such as its pixel_size).
const func get_draw_flag(flag: int enumLabel3D.DrawFlags) -> bool#
Returns the value of the specified flag.
func set_draw_flag(enabled: bool) -> void#
If true, the specified flag will be enabled. See Label3D.DrawFlags for a list of flags.
Annotations #
Constants #
const FLAG_SHADED = 0 enum DrawFlags#
If set, lights in the environment affect the label.
const FLAG_DOUBLE_SIDED = 1 enum DrawFlags#
If set, text can be seen from the back as well. If not, the text is invisible when looking at it from behind.
const FLAG_DISABLE_DEPTH_TEST = 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.
const FLAG_FIXED_SIZE = 3 enum DrawFlags#
Label is scaled by depth so that it always appears the same size on screen.
const FLAG_MAX = 4 enum DrawFlags#
Represents the size of the DrawFlags enum.
const ALPHA_CUT_DISABLED = 0 enum AlphaCutMode#
This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping. GeometryInstance3D.cast_shadow has no effect when this transparency mode is used; the Label3D will never cast shadows.
const ALPHA_CUT_DISCARD = 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 ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa). This mode is also known as alpha testing or 1-bit transparency.
Note: This mode might have issues with anti-aliased fonts and outlines, try adjusting alpha_scissor_threshold or using MSDF font.
Note: When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline.
const ALPHA_CUT_OPAQUE_PREPASS = 2 enum AlphaCutMode#
This mode draws fully opaque pixels in the depth prepass. This is slower than ALPHA_CUT_DISABLED or ALPHA_CUT_DISCARD, but it allows displaying translucent areas and smooth edges while using proper sorting.
Note: When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline.
const ALPHA_CUT_HASH = 3 enum AlphaCutMode#
This mode draws cuts off all values below a spatially-deterministic threshold, the rest will remain opaque.
Constructors #
Enums #
DrawFlags#
enum DrawFlags {
FLAG_SHADED = 0,
FLAG_DOUBLE_SIDED = 1,
FLAG_DISABLE_DEPTH_TEST = 2,
FLAG_FIXED_SIZE = 3,
FLAG_MAX = 4,
}AlphaCutMode#
enum AlphaCutMode {
ALPHA_CUT_DISABLED = 0,
ALPHA_CUT_DISCARD = 1,
ALPHA_CUT_OPAQUE_PREPASS = 2,
ALPHA_CUT_HASH = 3,
}