Lens Scripting API

    This class represents a container frame that can hold and manage UI elements. It provides settings for auto show/hide, inner size, border, constant padding, and scaling. The class uses prefabs for the frame and labeled buttons, and textures for icons.

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    allowTranslation: boolean = true

    Enables moving the container 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.

    billboardComponent: Billboard = null
    border: number = 7

    Width of the border around the container.

    closeButton: LabeledPinchButton
    constantPadding: vec2 = ...

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

    currentInteractor: Interactor = null
    cutOut: boolean = false

    When enabled, creates a transparent center in the frame, allowing content behind the container to be visible.

    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    followButton: LabeledPinchButton

    event for callback on close button trigger

    forceTranslate: boolean = false
    innerSize: vec2 = ...

    Size of the container's inner content area.

    isFollowing: boolean = false

    Controls whether the container actively follows the user's view. Setting this defines the initial state.

    material: Material
    name: string
    onHoverEnterInnerInteractable: PublicApi<void> = ...
    onHoverExitInnerInteractable: PublicApi<void> = ...
    onScalingEnd: default = ...

    event handler for frame scaling ended

    onScalingEndEvent: PublicApi<void> = ...

    public api for adding functions to the onScalingEnd event handler

    onScalingStart: default = ...

    event handler for frame scaling started

    onScalingStartEvent: PublicApi<void> = ...

    public api for adding functions to the onScalingStart event handler

    onScalingUpdateEvent: PublicApi<void> = ...

    public api for adding functions to the onScalingUpdate event handler

    onSnappingComplete: PublicApi<void> = null

    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

    parentHoverBehavior: HoverBehavior

    reference to HoverBehavior on parent element

    parentTransform: Transform
    relativeZ: boolean = false

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

    scalingSizeStart: vec2 = null
    sceneObject: SceneObject

    The scene object this component is on.

    showCloseButton: boolean = true
    showFollowButton: boolean = false
    smoothFollow: SmoothFollow = null

    reference to frame's default front follow behavior

    uniqueIdentifier: string
    updatePriority: number
    worldCamera: Camera = ...

    reference to world camera

    Accessors

    • get backingAlpha(): number

      Returns number

      alpha of the dark backing effect of the frame

    • set backingAlpha(alpha: number): void

      Parameters

      • alpha: number

        sets alpha of the dark backing effect of the frame

      Returns void

    • get borderAlpha(): number

      Returns number

      alpha of the glass border of the frame

    • set borderAlpha(alpha: number): void

      Parameters

      • alpha: number

        sets alpha of the glass border of the frame

      Returns void

    • get cutOutCenter(): boolean

      returns if center is cutout

      Returns boolean

    • set cutOutCenter(cutOut: boolean): void

      Parameters

      • cutOut: boolean

      Returns void

      cutOut:boolean enable or disable graphical cutout of center of container useful for content behind the container in z space

    • get enableInteractionPlane(): boolean

      Returns boolean

    • set enableInteractionPlane(enabled: boolean): void

      Parameters

      • enabled: boolean

      Returns void

    • get localPosition(): vec3

      Returns vec3

      current local position of frame

    • set localPosition(position: vec3): void

      Parameters

      • position: vec3

        sets current local position of frame

      Returns void

    • get localRotation(): quat

      Returns quat

      current local rotation of frame

    • set localRotation(rotation: quat): void

      Parameters

      • rotation: quat

        set current local rotation of frame

      Returns void

    • get localScale(): vec3

      Returns vec3

      current world scale of frame

    • set localScale(scale: vec3): void

      Parameters

      • scale: vec3

        set current local scale of 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 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 totalInnerSize(): vec2

      Returns vec2

      vec2 of the total size of the container, including constant padding

    • get worldPosition(): vec3

      Returns vec3

      current world position of frame

    • set worldPosition(position: vec3): void

      Parameters

      • position: vec3

        sets current world position of frame

      Returns void

    • get worldRotation(): quat

      Returns quat

      current world rotation of frame

    • set worldRotation(rotation: quat): void

      Parameters

      • rotation: quat

        sets current local position of frame

      Returns void

    • get worldScale(): vec3

      Returns vec3

      current world scale of frame

    • set worldScale(scale: vec3): void

      Parameters

      • scale: vec3

        set current world scale of frame

      Returns void

    Methods

    • abort snapping behavior

      Returns void

    • Parameters

      • enabled: boolean

        set close button enabled or disabled

      Returns void

    • Parameters

      • enabled: boolean

        set follow button enabled or disabled

      Returns void

    • Parameters

      • isInteractable: boolean

        enable or disable interactable elements of the frame

      Returns void

    • Returns vec3

      current local position of frame

    • Returns quat

      current local rotation of frame

    • Gets current world position of frame

      Returns vec3

    • Returns quat

      current world rotation of frame

    • tween to hide visuals of frame and elementss

      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

    • function for fully destroying the frame

      Returns void

    • Parameters

      • allowScaling: boolean

        enable or disable user scaling

      Returns void

    • setup billboarding component with the following parameters

      Parameters

      • useBillboard: boolean
      • xOnTranslate: boolean = false
      • xAlways: boolean = false
      • yOnTranslate: boolean = false
      • yAlways: boolean = false

      Returns void

    • set diameter of buttons in centimeters

      Parameters

      • size: number

      Returns void

    • Parameters

      • opacity: number

        sets opacity of frame when hovering interactable content in the frame

      Returns void

    • Parameters

      Returns void

    • Parameters

      • isInteractable: boolean

        set if content is interactable

      Returns void

    • Parameters

      • isFollowing: boolean

        enable or disable the following button and defualt behavior ( if it is enabled )

      Returns void

    • Parameters

      • isSnappable: boolean

        turns on or off snappableBehavior

      Returns void

    • Parameters

      • position: vec3

        sets current local position of frame

      Returns void

    • Parameters

      • rotation: quat

        set current local rotation of frame

      Returns void

    • Parameters

      • maximumSize: vec2

        set maximum scale of frame

      Returns void

    • Parameters

      • minimumSize: vec2

        set minimum scale of frame

      Returns void

    • Parameters

      • isActive: boolean

        whether or not to activate snapping

      Returns void

    • Parameters

      • useBillboarding: boolean

      Returns void

    • Parameters

      • useFollow: boolean

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

      Returns void

    • Parameters

      • enable: boolean

      Returns void

    • Parameters

      • enable: boolean

      Returns void

    • Parameters

      • position: vec3

        sets current world position of frame

      Returns void

    • Parameters

      • rotation: quat

        sets current local position of frame

      Returns void

    • Parameters

      • yAlways: boolean

      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

    MMNEPVFCICPMFPCPTTAAATR