Label3D
A node for displaying plain text in 3D space.
Label3D.swift:11class Label3D
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.
Superclasses
class GeometryInstance3D
Base node for geometry-based visual instances.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Types
Type members
Instance members
var alphaAntialiasingEdge: Double
Threshold at which antialiasing will be applied on the alpha channel.
var alphaAntialiasingMode: BaseMaterial3D.AlphaAntiAliasing
The type of alpha antialiasing to apply. See
BaseMaterial3D.AlphaAntiAliasing
.var alphaCut: Label3D.AlphaCutMode
The alpha cutting mode to use for the sprite. See
AlphaCutMode
for possible values.var alphaHashScale: Double
The hashing scale for Alpha Hash. Recommended values between
0
and2
.var alphaScissorThreshold: Double
Threshold at which the alpha scissor will discard values.
var autowrapMode: TextServer.AutowrapMode
If set to something other than
TextServer/AutowrapMode/autowrapOff
, 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, seeTextServer.AutowrapMode
.var billboard: BaseMaterial3D.BillboardMode
The billboard mode to use for the label. See
BaseMaterial3D.BillboardMode
for possible values.var doubleSided: Bool
If
true
, text can be seen from the back as well, iffalse
, it is invisible when looking at it from behind.var fixedSize: Bool
If
true
, the label is rendered at the same size regardless of distance.var font: Font?
Font configuration used to display text.
var fontSize: Int32
Font size of the
Label3D
’s text. To make the font look more detailed when up close, increasefontSize
while decreasingpixelSize
at the same time.var horizontalAlignment: HorizontalAlignment
Controls the text’s horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the
HorizontalAlignment
constants.var justificationFlags: TextServer.JustificationFlag
Line fill alignment rules. For more info see
TextServer.JustificationFlag
.var language: String
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
var lineSpacing: Double
Vertical space between lines in multiline
Label3D
.var modulate: Color
Text
Color
of theLabel3D
.var noDepthTest: Bool
If
true
, depth testing is disabled and the object will be drawn in render order.var offset: Vector2
The text drawing offset (in pixels).
var outlineModulate: Color
The tint of text outline.
var outlineRenderPriority: Int32
Sets the render priority for the text outline. Higher priority objects will be sorted in front of lower priority objects.
var outlineSize: Int32
Text outline size.
var pixelSize: Double
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
fontSize
while decreasingpixelSize
at the same time.var renderPriority: Int32
Sets the render priority for the text. Higher priority objects will be sorted in front of lower priority objects.
var shaded: Bool
If
true
, theLight3D
in theEnvironment
has effects on the label.var structuredTextBidiOverride: TextServer.StructuredTextParser
Set BiDi algorithm override for the structured text.
var structuredTextBidiOverrideOptions: GArray
Set additional options for BiDi override.
var text: String
The text to display on screen.
var textDirection: TextServer.Direction
Base text writing direction.
var textureFilter: BaseMaterial3D.TextureFilter
Filter flags for the texture. See
BaseMaterial3D.TextureFilter
for options.var uppercase: Bool
If
true
, all the text displays as UPPERCASE.var verticalAlignment: VerticalAlignment
Controls the text’s vertical alignment. Supports top, center, bottom. Set it to one of the
VerticalAlignment
constants.var width: Double
Text width (in pixels), used for autowrap and fill alignment.
func generateTriangleMesh(
) -> TriangleMesh? Returns a
TriangleMesh
with the label’s vertices following its current configuration (such as itspixelSize
).