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
    onScrolled: PublicApi<number> = ...

    Event that is invoked when the scrollbar value changes. Provides the current normalized value (0-1) of the scrollbar position.

    sceneObject: SceneObject

    The SceneObject this component is on.

    uniqueIdentifier: string
    updatePriority: number

    Accessors

    • get currentValue(): number

      Gets the current value of the scrollbar.

      Returns number

      The current value of the scrollbar.

    • get inactive(): boolean

      Gets whether the scrollbar is inactive.

      Returns boolean

      true if the scrollbar is inactive; otherwise, false.

    • set inactive(inactive: boolean): void

      Sets whether the scrollbar is inactive.

      Parameters

      • inactive: boolean

        A boolean indicating whether the scrollbar should be inactive (true) or not (false).

      Returns void

    • get isScrollable(): boolean

      Gets whether the scrollbar is scrollable.

      Returns boolean

      true if the scrollbar is scrollable; otherwise, false.

    • get playAudio(): boolean

      Gets whether audio should be played for scrollbar interactions.

      Returns boolean

      true if audio should be played; otherwise, false.

    • set playAudio(playAudio: boolean): void

      Sets whether audio should be played for scrollbar interactions.

      Parameters

      • playAudio: boolean

        A boolean indicating whether audio should be played (true) or not (false).

      Returns void

    • get renderOrder(): number

      Gets the render order of the scrollbar.

      Returns number

      The render order of the scrollbar.

    • set renderOrder(order: number): void

      Sets the render order of the scrollbar.

      Parameters

      • order: number

        The render order of the scrollbar.

      Returns void

    Methods

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

      Parameters

      • type: string

      Returns boolean

    • Lifecycle method called when the component awakens. Initializes the scrollbar by creating the slider component, setting up visuals, and configuring event handlers.

      Returns void