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

    allowNonUniformScaling: boolean = false

    Allows the container to scale width and height independently. When enabled, scaling is non-uniform and each axis is clamped to its configured min/max size limits.

    allowTranslation: boolean = true

    Enables moving the frame.

    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.

    autoScaleContent: boolean = true

    Automatically scales child content when the frame is resized to maintain proportions.

    autoShowHide: boolean = true

    When enabled, the frame automatically appears when hovered and hides when not being interacted with. Disable to manually control frame visibility.

    collider: ColliderComponent = ...
    content: SceneObject
    currentInteractor: Interactor = null

    Current interactor that is interacting with the frame.

    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    frameObject: SceneObject
    isEnabledInHierarchy: boolean

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

    name: string
    onHideVisual: PublicApi<void> = ...

    Public api for adding functions to the onHideVisualEvent event handler.

    onHideVisual is invoked when the frame has finished hiding its visuals.

    onHoverEnterInnerInteractable: PublicApi<void> = ...
    onHoverExitInnerInteractable: PublicApi<void> = ...
    onInitialized: PublicApi<void> = ...

    Public api for adding functions to the onInitializedEvent event handler.

    onScalingEnd: PublicApi<void> = ...

    Public api for adding functions to the onScalingEnd event handler.

    onScalingStart: PublicApi<void> = ...

    Public api for adding functions to the onScalingStart event handler.

    onScalingUpdate: PublicApi<void> = ...

    Public api for adding functions to the onScalingUpdate event handler.

    onShowVisual: PublicApi<void> = ...

    Public api for adding functions to the onShowVisualEvent event handler.

    onShowVisual is invoked when the frame starts to show its visuals.

    onSnappingComplete: PublicApi<void> = ...

    Public api for adding functions to the onSnappingComplete event handler.

    onTranslationEnd: PublicApi<void> = ...

    Public api for adding functions to the _onTranslationEndEvent event handler.

    onTranslationStart: PublicApi<void> = ...

    Public api for adding functions to the onTranslationStartEvent event handler.

    relativeZ: boolean = true

    When enabled, Z-axis scaling of content will match X-axis scaling during frame resizing.

    sceneObject: SceneObject

    The SceneObject this component is on.

    smoothFollow: SmoothFollow = null

    Reference to frame's default front follow behavior.

    uniqueIdentifier: string
    updatePriority: number

    Accessors

    • get allowScaling(): boolean

      Returns boolean

      whether interactive scaling of the frame via corner handles is enabled

    • set allowScaling(allowScaling: boolean): void

      Sets whether interactive scaling of the frame via corner handles is enabled

      Parameters

      • allowScaling: boolean

        if true, scaling is enabled through the corner handles

      Returns void

    • get billboardComponent(): Billboard

      Billboard component for the frame, used for automatic rotation to face the camera/user.

      Returns Billboard

    • get border(): number

      Width of the border around the frame.

      Returns number

    • set border(border: number): void

      Parameters

      • border: number

      Returns void

    • get contentTransform(): Transform

      Transform of content parent SceneObject.

      Returns Transform

    • get cutOutCenter(): boolean

      Returns boolean

    • set cutOutCenter(cutOut: boolean): void

      Parameters

      • cutOut: boolean

      Returns void

    • get following(): boolean

      Returns boolean

    • get forceTranslate(): boolean

      Returns boolean

    • set forceTranslate(forceTranslate: boolean): void

      Parameters

      • forceTranslate: boolean

      Returns void

    • get grabZoneOnly(): boolean

      Returns boolean

      whether the frame only allows interaction in the grab zones

    • set grabZoneOnly(only: boolean): void

      Sets whether the frame only allows interaction in the grab zones

      Parameters

      • only: boolean

        if true, interaction is limited to the grab zones

      Returns void

    • get grabZones(): vec4[]

      Returns vec4[]

      the current grab zones of the frame

    • set grabZones(grabZones: vec4[]): void

      Sets the grab zones of the frame, which are used for interaction

      Parameters

      Returns void

    • get innerSize(): vec2

      Size of the frames's inner content area.

      Returns vec2

    • set innerSize(size: vec2): void

      Parameters

      Returns void

    • get interactionPlaneOffset(): vec3

      Get the offset position for the interaction plane relative to the frame center.

      Returns vec3

    • set interactionPlaneOffset(offset: vec3): void

      Set the offset position for the interaction plane relative to the frame center.

      Parameters

      • offset: vec3

        The new offset.

      Returns void

    • get interactionPlanePadding(): vec2

      Get the size of the padding around the InteractionPlane.

      Returns vec2

    • set interactionPlanePadding(padding: vec2): void

      Set the size of the padding around the InteractionPlane.

      Parameters

      • padding: vec2

        The new padding.

      Returns void

    • get maximumSize(): vec2

      Returns vec2

      current maximum size of frame elements

    • set maximumSize(maximumSize: vec2): void

      Parameters

      Returns void

    • get minimumSize(): vec2

      Returns vec2

      current minimum size of frame elements

    • set minimumSize(minimumSize: vec2): void

      Parameters

      Returns void

    • get onlyInteractOnBorder(): boolean

      gets the onlyInteractOnBorder setting

      Returns boolean

    • set onlyInteractOnBorder(onlyInteractOnBorder: boolean): void

      sets the onlyInteractOnBorder setting

      Parameters

      • onlyInteractOnBorder: boolean

        if true, interaction is limited to the border of the frame

      Returns void

    • get opacity(): number

      Returns number

      current opacity of frame elements

    • set opacity(opacity: number): void

      Parameters

      • opacity: number

        sets opacity for all frame elements Note this parameter is effected by calls to showVisual and hideVisual.

      Returns void

    • get padding(): vec2

      Extra padding that maintains a fixed size in centimeters regardless of frame scaling, useful for toolbars and fixed-size UI elements

      Returns vec2

    • set padding(padding: vec2): void

      Parameters

      Returns void

    • get renderOrder(): number

      Returns number

      current renderOrder for the renderMeshVisual of the frame itself

    • set renderOrder(renderOrder: number): void

      Parameters

      • renderOrder: number

        sets renderOrder for the renderMeshVisual of the frame itself

      Returns void

    • get scalingSizeStart(): vec2

      Getter for the initial scaling size.

      Returns vec2

    • set scalingSizeStart(thisSize: vec2): void

      Setter for the initial scaling size.

      Parameters

      Returns void

    • get showCloseButton(): boolean

      Shows a button that allows users to close or dismiss the frame.

      Returns boolean

    • set showCloseButton(show: boolean): void

      Parameters

      • show: boolean

      Returns void

    • get showFollowButton(): boolean

      Shows a button that allows users to toggle whether the frame follows their view as they move.

      Returns boolean

    • set showFollowButton(show: boolean): void

      Parameters

      • show: boolean

      Returns void

    • get totalSize(): vec2

      TotalSize is the total size of the frame including border and padding in local space centimeters.

      Returns vec2

    Methods

    • tween to hide visuals of frame and elements

      Returns void

    • Initializes the frame component, setting up its visual appearance, interaction capabilities,

      Returns void

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

      Parameters

      • type: string

      Returns boolean

    • Returns boolean

      whether the snapping behavior is checking for snappable elements

    • Returns boolean

      whether the snapping behavior is currently tweening

    • Returns void

    • Sets the buffer degrees for the billboard component. Will only be effective if Frame's billboarding is set to true, and xAlways and/or yAlways is set to true.

      Parameters

      • xBufferDegrees: number

        the buffer degrees for the x-axis

      • yBufferDegrees: number

        the buffer degrees for the y-axis

      Returns void

    • Parameters

      • following: boolean

      Returns void

    • Parameters

      • useFollow: boolean

        enable or disable the option to turn on the default follow behavior with the follow button

      Returns void

    • tween to show visuals of frame and elements

      Returns void

    • tween from current opacity to target opacity, will cancel existing opacity tweens

      Parameters

      • currentOpacity: number
      • targetOpacity: number
      • endCallback: () => void = ...

      Returns void