Preparing search index...

    Class Text3D

    Renders 3D text with specific style, layout and material.

    3D Text guide.

    Lens Scripting Version 159

    Hierarchy (View Summary)

    Index

    Properties

    capitilizationOverride: CapitilizationOverride

    Overrides the capitalization of the text rendered.

    Lens Scripting Version 159

    CapitilizationOverride.None
    
    debugRenderLayoutRect: boolean

    If enabled, draws the Text3D#layoutRect bounds as a wireframe for debugging text layout. Has no effect when a ScreenTransform is attached to the same SceneObject, since the ScreenTransform supersedes the layoutRect.

    Lens Scripting Version 364

    false
    
    editable: boolean

    Makes the Text component editable. When this is enabled the Text can be clicked to open up the device keyboard and edit the contents.

    Lens Scripting Version 165

    false
    
    enableBatching: boolean

    Optimizes Text3D by combining glyph meshes.

    Lens Scripting Version 303

    false
    
    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    true
    
    enableRichText: boolean

    If enabled, inputted text will be interpreted as rich text.

    Lens Scripting Version 356

    false
    
    extentsTarget: ScreenTransform

    When a ScreenTransform is present on this SceneObject, and extentsTarget is a child of this SceneObject, extentsTarget will be repositioned to match the exact area this MeshVisual is being rendered. Very useful for Image and Text components.

    null
    
    extrudeDirection: Text3DExtrudeDirection

    Starting from the Text3D's local position control whether the meshes are extruded forwards, backwards, or both directions

    Lens Scripting Version 159

    Text3DExtrudeDirection.Both
    
    extrusionDepth: number

    How deep the text meshes should be relative to the line height. 0-1 portion of the basic height which will be used for mesh depth. Values > 1 are valid.

    Lens Scripting Version 159

    0.4
    
    font: Font

    Font asset used.

    Setting this will override any existing Font, FontFamily, or FontCollection asset assigned as the font source of the text component. If there is a FontFamily or FontCollection asset currently assigned as the font source, reading this will return null.

    Lens Scripting Version 159

    null
    

    The font source for this text component. Can be a Font, FontFamily, or FontCollection asset.

    Lens Scripting Version 356

    null
    
    horizontalAlignment: HorizontalAlignment

    When a ScreenTransform is attached to the same SceneObject, this controls how the mesh will be positioned horizontally depending on stretchMode.

    HorizontalAlignment.Center
    
    horizontalOverflow: HorizontalOverflow

    Controls how text should be handled when it goes past the horizontal boundaries defined by ScreenTransform or Text#layoutRect, with the former taking precedence.

    Lens Scripting Version 159

    HorizontalOverflow.Overflow
    
    isBeingDestroyed: boolean

    Returns true if this Component is currently being destroyed. Becomes true as soon as destruction begins via Component#destroy or destruction of its owning SceneObject, before any OnDestroyEvent callbacks fire.

    Lens Scripting Version 364

    if (!script.isBeingDestroyed) {
    // Component is still fully alive
    }
    isEnabledInHierarchy: boolean

    Returns true if this Component, its SceneObject, and all of that SceneObjects parents are enabled.

    italic: boolean

    If enabled, the rendered text will try to use an italic font style.

    Lens Scripting Version 325

    false
    
    layoutRect: Rect

    The rectangular bounds the text is laid out within. Controls text wrapping and alignment, and defines the area Text3D#horizontalOverflow, Text3D#verticalOverflow, and Text3D#sizeToFit are evaluated against.

    Each bound is defined as an offset in world units from the SceneObject's position.

    If a ScreenTransform is attached to the same SceneObject, it always supersedes this property — text is laid out within the ScreenTransform's rect instead, and changes to layoutRect have no effect.

    Lens Scripting Version 364

    letterSpacing: number

    Modifies the spacing between letters. A value of 0 uses the font’s normal letter spacing. Negative values will remove space between letters, and positive values will add more space between letters.

    Lens Scripting Version 159

    0
    
    lineSpacing: number

    Modifies the vertical spacing between lines, as a multiple of lines. 1 will be single spacing, 2 will be double spaced, and 0.5 would be half the normal line height.

    Lens Scripting Version 159

    1
    
    mainMaterial: Material

    Returns the first Material.

    Lens Scripting Version 304

    null
    
    mainPass: Pass

    Returns the mainPass of the mainMaterial.

    Lens Scripting Version 304

    null
    
    mainPassOverrides: PassPropertyOverrides

    Overrides the mainPass on the material, without affecting other visuals referencing the same material.

    Lens Scripting Version 304

    materials: Material[]

    Get the array of materials used by the MaterialMeshVisual.

    Lens Scripting Version 304

    []
    
    meshShadowMode: MeshShadowMode

    None = 0, Caster = 1, Receiver = 2

    MeshShadowMode.None
    
    onEditingFinished: event1<string, void>

    This event will notify you when the user finishes editing the text.

    Lens Scripting Version 159

    onEditingStarted: event0<void>

    This event will notify you when the user starts typing.

    Lens Scripting Version 159

    onEditingUpdated: event1<string, void>

    This event will notify you on every edit to the text while the user is typing.

    Lens Scripting Version 159

    propertyOverrides: PropertyOverrides

    Overrides the property on the material, without affecting other visuals referencing the same material.

    Lens Scripting Version 304

    renderOrder: number

    The order in which the visual should be rendered.

    Lens Scripting Version 323

    0
    
    sceneObject: SceneObject

    The SceneObject this component is on.

    shadowColor: vec4

    Affects the color of shadows being cast by this MeshVisual. The color of the cast shadow is a mix between shadowColor and the material's base texture color. The alpha value of shadowColor controls the mixing of these two colors, with 0 = shadowColor and 1 = shadowColor * textureColor.

    (1, 1, 1, 1)
    
    shadowDensity: number

    Density of shadows cast by this MeshVisual.

    1
    
    showEditingPreview: boolean

    Use this property to control whether to show the input preview the keyboard. Note this preview also enables cursor movement.

    Lens Scripting Version 170

    true
    
    size: number

    Font size used. Minimum of 2.0 and maximum of 800.0.

    size sets the em square height of the rendered text.

    In world space, the em square height in centimeters is size / 43.886, so the default size of 48 produces an em square ~1.09 cm tall.

    Under a Canvas in Pixels or Points mode, Text scales as though the camera's orthographic size were the default 20 cm regardless of the actual camera size. The em square is renderTargetHeightPoints * size / 877.71 points tall — about 39 points for the default size of 48 on a render target 720 points tall. The pixel form is the same expression with the render target height in pixels.

    Lens Scripting Version 159

    48
    
    sizeToFit: boolean

    If enabled, the rendered text will always scale to fit the boundaries defined by ScreenTransform or Text#layoutRect, with the former taking precedence.

    Lens Scripting Version 159

    false
    
    stretchMode: StretchMode

    When a ScreenTransform is attached to the same SceneObject, this controls how the mesh will be stretched relative to the ScreenTransform's boundaries.

    StretchMode.Stretch
    
    text: string

    Text string to be drawn.

    Lens Scripting Version 159

    ""
    
    touchHandler: InteractionComponent

    Use this property to override the touch handling for when to open the device keyboard when the Text is editable.

    Lens Scripting Version 165

    null
    
    uniqueIdentifier: string

    Lens Scripting Version 176

    verticalAlignment: VerticalAlignment

    When a ScreenTransform is attached to the same SceneObject, this controls how the mesh will be positioned vertically depending on stretchMode.

    VerticalAlignment.Center
    
    verticalOverflow: VerticalOverflow

    Controls how text should be handled when it goes past the vertical boundaries defined by ScreenTransform or Text#layoutRect, with the former taking precedence.

    Lens Scripting Version 159

    VerticalOverflow.Overflow
    
    weight: number

    Controls the font weight. Usually a multiple of 100 between 100 and 900 inclusively. Will use closest font weight available on the system.

    Lens Scripting Version 325

    400
    
    worldSpaceRect: Rect

    Use Text3D#layoutRect instead.

    Lens Scripting Version 364

    Methods

    • Parameters

      • Optionalstart: number
      • Optionalend: number

      Returns Rect

      Lens Scripting Version 317

    • Returns the recommended height for a cursor visual, in the same coordinate space as getCursorPositions(). The height is derived from the font size and accounts for scaling (e.g. VerticalOverflow.Shrink or sizeToFit).

      Returns number

      Lens Scripting Version 361

    • Returns a list of cursor positions for each character in the current text. Not supported when rich text is enabled.

      Returns CursorPosition[]

      Lens Scripting Version 324

    • Returns a list of rectangles highlighting the characters in the range from start to end. Each rectangle covers one contiguous visual run of text within the range, so a single line with mixed text directions may produce multiple rectangles. The range is inclusive of start and exclusive of end.

      Parameters

      • Optionalstart: number
      • Optionalend: number

      Returns Rect[]

      Lens Scripting Version 362

    • Returns the number of Materials used for rendering.

      Returns number

      Lens Scripting Version 304

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Range maximum of the local-space axis-aligned bounding box (AABB) of the visual.

      Returns vec3

      Lens Scripting Version 156

    • Range minimum of the local-space axis-aligned bounding box (AABB) of the visual.

      Returns vec3

      Lens Scripting Version 156

    • Sets the order of this Visual in the render queue.

      Parameters

      • value: number

      Returns void

    • Projects screen positions from camera's view onto the mesh's UVs. If the MeshVisual's material uses the same texture as the camera input, the MeshVisual will look identical to the part of the screen it covers.

      Parameters

      Returns void

    • Splits the Text3D into individual RenderMeshVisuals. This destroys the Text3D component and you can no longer edit its properties like text.

      Returns RenderMeshVisual[]

      Lens Scripting Version 160

    • Range maximum of the world-space axis-aligned bounding box (AABB) of the visual.

      Returns vec3

      Lens Scripting Version 156

    • Range minimum of the world-space axis-aligned bounding box (AABB) of the visual.

      Returns vec3

      Lens Scripting Version 156