Textcomponent

TextComponent class

Text component, used to display text in the game.

See TextComponentData for the data schema used to create a text component

Signature:

export declare class TextComponent extends Component3D<TextComponentData> 

Extends: Component3D<TextComponentData>

Properties

Property

Modifiers

Type

Description

align

TextAlignment

How text should be aligned. Defaults to "left"

font

FontFamily

Font to use

lineHeight

number

Line height of the text. Defaults to 60

opacity

number

Opacity of the text. Defaults to 1

text

string

Text to display

textColor

string

Color of the text. Defaults to "#ffffff"

textTransform

string

Optional transform to apply to the text. Defaults to "none"

width

number

Width of the text box. Defaults to 500. Use this to avoid breaking a long into multiple lines

Methods

Method

Modifiers

Description

dispose()

protected

init()

protected