Controls a text rendering texture. Can be accessed through the main rendering pass on a Label component. The properties here mirror those on Label.

// Sets the text to be used on a label's text rendering texture

//@input Component.Label label

var control = script.label.mainPass.baseTex.control;
control.text = "New Text";
interface TextProvider {
    fontAsset: Font;
    outlineColor: vec4;
    outlineSize: number;
    shadowColor: vec4;
    shadowOffset: vec2;
    size: number;
    text: string;
    textColor: vec4;
    useDropshadow: boolean;
    useOutline: boolean;
    getAspect(): number;
    getHeight(): number;
    getLoadStatus(): LoadStatus;
    getTypeName(): string;
    getWidth(): number;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
}

Hierarchy (view full)

Properties

fontAsset: Font

The font used for rendering text.

outlineColor: vec4

The color used for the outline effect.

outlineSize: number

The strength of the outline effect.

shadowColor: vec4

The color used for dropshadow.

shadowOffset: vec2

The horizontal and vertical offset used for dropshadow.

size: number

The font size being used.

text: string

The text being rendered.

textColor: vec4

The color for rendering text.

useDropshadow: boolean

If enabled, adds a dropshadow to the text.

useOutline: boolean

If enabled, renders an outline around the text.

Methods

  • Returns the texture's aspect ratio, which is calculated as width / height.

    Returns number

  • Returns the width of the texture in pixels.

    Returns number

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

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean