Preparing search index...

    Used to bind custom JavaScript or TypeScript code to specific Lens events for dynamic interactivity.

    These Script Components are attached to SceneObjects, providing the ability to modify properties and behaviors of those objects or others within the scene. Script Components expose input fields in the Inspector panel, allowing for customization of script behavior without altering code. Any script can access the ScriptComponent executing them through the variable script.

    // Bind a function to the MouthOpened event
    function onMouthOpen(eventData)
    {
    print("mouth was opened");
    }
    var event = script.createEvent("MouthOpenedEvent");
    event.bind(onMouthOpen);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    api: Record<string, any>

    Generic object accessible by other instances of ScriptComponent. Use this object to store references to properties and methods that need to be accessible from other ScriptComponents.

    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    isEnabledInHierarchy: boolean

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

    name: string
    onDestroy: PublicApi<void> = ...
    sceneObject: SceneObject

    The SceneObject this component is on.

    uniqueIdentifier: string
    updatePriority: number

    Accessors

    • get renderOrder(): number

      The render order of the tooltip.

      Returns number

    • set renderOrder(value: number): void

      The render order of the tooltip.

      Parameters

      • value: number

      Returns void

    • get tip(): string

      The current tooltip text.

      Returns string

      The tooltip string associated with this instance.

    • set tip(value: string): void

      The current tooltip text.

      Parameters

      • value: string

        The new tooltip text to display.

      Returns void

    Methods

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

      Parameters

      • type: string

      Returns boolean

    • Returns void

    • Sets the tooltip's visibility state.

      Parameters

      • isOn: boolean

        If true, the tooltip will be shown; if false, it will be hidden.

        This method fades the tooltip's alpha to 1 (visible) or 0 (hidden) depending on the isOn parameter, provided that both backing and textComponent are present.

      Returns void

    • Parameters

      • OptionalonComplete: () => void

      Returns void