Text3d

Classes

Text3D : NativeComponent

This component is used to display 3D text in the scene. The text is always facing the camera.

Example:

let node = create_node(NodeData(parent=node))
add_component(node, new Text3D(text = "3D text"))
Properties:

Text3D.useDepthScale: bool
Text3D.useDepthScale =(value: bool)

If true, the text will be scaled based on the distance from the camera. If false, the text will be the same size regardless of distance. Default is true.

Arguments:
  • value : bool

Text3D.text: string
Text3D.text =(value: string)

UIText content to be rendered.

Arguments:
  • value : string

Text3D.pivot: float2
Text3D.pivot =(value: float2)

Pivot point of the text. The value is in the range of 0 to 1. Default is (0.5, 0.5).

Arguments:
  • value : float2

Text3D.size: float2
Text3D.size =(value: float2)

Max size of the text’s bounding box. Default is (-1, -1)

(-1, -1) means the box will be calculated automatically.

Arguments:
  • value : float2

Text3D.color: float4
Text3D.color =(value: float4)

Color of the text. Default is white.

Arguments:
  • value : float4

Text3D.fontSize: float
Text3D.fontSize =(value: float)

Font height of the text. The size in pixels will be determined by the font and the scale of the node. Default is 16.0.

Arguments:
  • value : float

Text3D.fontScaling: bool
Text3D.fontScaling =(value: bool)

Font scaling. If enabled, applies node scale to the font instead of the text element. Default it true.

Arguments:
  • value : bool

Text3D.fontId: FontId
Text3D.fontId =(value: FontId)

Font resource id. Default is null it is equal to the default font.

Arguments:
Text3D.effect: TextEffect
Text3D.effect =(value: TextEffect)

UIText effect. Can be None, Shadow, Glow or Outline. Default is None.

Arguments:
Text3D.effectColor: float4
Text3D.effectColor =(value: float4)

Color of text effect. Default is white.

Arguments:
  • value : float4

Text3D.effectOffset: float2
Text3D.effectOffset =(value: float2)

Offset of the text effect. Default is (0, 0).

Arguments:
  • value : float2

Text3D.effectThickness: float
Text3D.effectThickness =(value: float)

Thickness of the text effect. Default is 1.

Arguments:
  • value : float

Text3D.textSize: float2

Actual size of the text’s bounding box. This field is read-only.

Text3D.rect: float4

Bounding box of the text. Its size is max(size, textSize). This field is read-only.

Text3D.fontAutoSize: float2
Text3D.fontAutoSize =(value: float2)

Limit of font size. Default is (-1, -1) which means no limit.

Arguments:
  • value : float2

Text3D.wordWrapping: bool
Text3D.wordWrapping =(value: bool)

Word wrapping. Default is true.

If size is (-1, -1) then word wrapping will not take effect.

Arguments:
  • value : bool

Text3D.margin: float4
Text3D.margin =(value: float4)

UIText margin (left, top, right, bottom). Default is (0, 0, 0, 0).

Arguments:
  • value : float4

Text3D.horAlignment: TextHorAlignment
Text3D.horAlignment =(value: TextHorAlignment)

Horizontal text alignment. Can be Left, Center or Right. Default is Center

Arguments:
Text3D.vertAlignment: TextVertAlignment
Text3D.vertAlignment =(value: TextVertAlignment)

Vertical text alignment. Can be Top, Middle or Bottom. Default is Middle

Arguments: