Settings for rendering the background on a Text component. Accessible through the Text component's backgroundSettings property.

//@input Component.Text textComponent

// Access the background object for a Text component
var bg = script.textComponent.backgroundSettings;

// Enable the background
bg.enabled = true;

// Set the background color
bg.fill.color = new vec4(1, 0, .5, 1);

// Extend the background left and right by 1 unit
bg.margins.left = 1.0;
bg.margins.right = 1.0;
interface BackgroundSettings {
    cornerRadius: number;
    enabled: boolean;
    fill: TextFill;
    margins: Rect;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
}

Hierarchy (view full)

Properties

cornerRadius: number

Controls how rounded the corner of the background should be.

enabled: boolean

If enabled, the background will be rendered.

fill: TextFill

Settings for how the inside of the background is drawn.

margins: Rect

Controls how far in each direction the background should extend away from the text.

Methods

  • 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