Preparing search index...

    TextInputField Component to add a TextField to a Spectacles Lens Uses text input system under the hood Automatically writes text into a mesh that is adjustable by scale and size

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    _colliderCenter: vec3 = ...
    _colliderFitElement: boolean = true
    _colliderSize: vec3 = ...
    _hasError: boolean = false
    _initialized: boolean = false
    _interactableStateMachine: InteractableStateMachine
    _isDragged: boolean = false

    Indicates whether the element is currently being dragged. This property is used to track the drag state of the element.

    _renderOrder: number = 0
    _size: vec3 = ...
    _style: SnapOS2Styles = SnapOS2Styles.Custom
    addCallbacks: boolean = false
    alternateIcon: Texture
    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.

    changeIconOnFocus: boolean = false
    colliderObject: SceneObject
    colliderShape: BoxShape
    colliderTransform: Transform
    contentRequiredOnDeactivate: boolean = false
    currentPosition: vec3 = ...
    currentScale: vec3 = ...
    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    fontFamily: Font
    fontSize: number = null

    custom font size if not set, it will automatically scale from size.y

    formatType: string = "date"
    icon: Texture
    inputType: TextInputType = "default"
    isEnabledInHierarchy: boolean

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

    managedComponents: Set<Component> = ...
    managedSceneObjects: Set<SceneObject> = ...
    name: string
    onEditMode: PublicApi<boolean> = ...

    called when this component enters edit mode

    onHoverEnter: PublicApi<void> = ...

    An event that is triggered when a hover interaction starts on the element.

    onHoverExit: PublicApi<void> = ...

    An event that is triggered when a hover interaction ends on the element.

    onInitialized: PublicApi<void> = ...

    A public API event that is triggered when the element is initialized.

    onKeyboardStateChanged: PublicApi<boolean> = ...

    called when the keyboard state changes uses a boolean isOpen to indicate if the keyboard is open or closed

    onReturnKeyPressed: PublicApi<string> = ...

    called when the return key is pressed on the keyboard uses the current value of the keyboard as its parameter

    onStateChanged: PublicApi<StateName> = ...

    An event that is triggered whenever the state of the element changes.

    onStateChangedEvent: ReplayEvent<StateName> = ...
    onTextChanged: PublicApi<string> = ...

    called when the underlying text value of this component changes uses the current value of the keyboard as its parameter

    onTriggerDown: PublicApi<void> = ...

    An event that is triggered when a trigger interaction starts on the element.

    onTriggerUp: PublicApi<void> = ...

    An event that is triggered when a trigger interaction ends on the element.

    onTyping: PublicApi<void> = ...

    called when the keyboard calls onTextChanged ie: anytime there is typing on the keyboard

    placeholderText: string = ""
    scaleOnHover: boolean = false

    do scale animation on hover

    sceneObject: SceneObject

    The SceneObject this component is on.

    stateName: StateName = StateName.default
    textComponent: Text
    uniqueIdentifier: string
    updatePriority: number
    useIcon: boolean = false
    visualEventHandlerUnsubscribes: unsubscribe[] = []

    Accessors

    • get collider(): ColliderComponent

      Gets the ColliderComponent instance associated with this element. The collider is used for detecting interactions or collisions with the element.

      Returns ColliderComponent

      The collider instance.

    • get colliderCenter(): vec3

      Gets the custom center position of the collider. This position is only used when colliderFitElement is false.

      Returns vec3

      The custom collider center position in local space coordinates.

    • set colliderCenter(center: vec3): void

      Sets the custom center position of the collider. This position is only applied when colliderFitElement is false.

      Parameters

      • center: vec3

        The custom collider center position in local space coordinates.

      Returns void

    • get colliderFitElement(): boolean

      Gets whether the collider automatically fits the element's size.

      Returns boolean

      True if the collider fits the element, false if using custom size/position.

    • set colliderFitElement(colliderFitElement: boolean): void

      Sets whether the collider should automatically fit the element's size.

      Parameters

      • colliderFitElement: boolean

        True to make the collider fit the element, false to use custom size/position.

      Returns void

    • get colliderSize(): vec3

      Gets the custom size of the collider. This size is only used when colliderFitElement is false.

      Returns vec3

      The custom collider size in local space coordinates.

    • set colliderSize(size: vec3): void

      Sets the custom size of the collider. This size is only applied when colliderFitElement is false.

      Parameters

      • size: vec3

        The custom collider size in local space coordinates.

      Returns void

    • get contentChildren(): SceneObject[]

      Gets the children of the element that are not managed by the element.

      Returns SceneObject[]

      The children of the element that are not managed by the element.

    • get contentChildrenCount(): number

      Gets the number of children of the element that are not managed by the element.

      Returns number

      The number of children of the element that are not managed by the element.

    • get deltaPosition(): vec3

      Returns vec3

    • get deltaScale(): vec3

      Returns vec3

    • get hasShadow(): boolean

      Gets whether the visual element has a shadow.

      Returns boolean

      Whether the visual element has a shadow.

    • set hasShadow(value: boolean): void

      Sets whether the visual element has a shadow. If the hasShadow is set to true, the shadowVisual object will be created and configured.

      Parameters

      • value: boolean

        Whether the visual element has a shadow.

      Returns void

    • get inactive(): boolean

      Returns boolean

      is inactive or not

    • set inactive(inactive: boolean): void

      Parameters

      • inactive: boolean

        set is inactive or is not inactive

      Returns void

    • get initialized(): boolean

      Indicates whether the element has been initialized.

      Returns boolean

      true if the element is initialized, otherwise false.

    • get interactable(): Interactable

      Gets the interactable property of the element.

      Returns Interactable

      The current interactable instance associated with this element.

    • get isDraggable(): boolean

      Determines whether the element is draggable.

      Returns boolean

      Always returns false, indicating that the element is not draggable.

    • get isToggle(): boolean

      Returns boolean

    • get playAudio(): boolean

      Gets the value indicating whether audio playback is enabled.

      Returns boolean

      true if audio playback is enabled; otherwise, false.

    • set playAudio(playAudio: boolean): void

      Sets the playAudio behavior and initializes the audio component if necessary.

      Parameters

      • playAudio: boolean

        A boolean indicating whether audio should be played. If set to true and the audio component is not already created, a new audio component will be instantiated and attached to the scene object.

      Returns void

    • get playTriggerDownAudio(): boolean

      Gets the value indicating whether trigger down audio playback is enabled.

      Returns boolean

      true if trigger down audio playback is enabled; otherwise, false.

    • set playTriggerDownAudio(playTriggerDownAudio: boolean): void

      Sets the playTriggerDownAudio behavior and initializes the audio component if necessary.

      Parameters

      • playTriggerDownAudio: boolean

        A boolean indicating whether trigger down audio should be played. If set to true and the audio component is not already created, a new audio component will be instantiated and attached to the scene object.

      Returns void

    • get playTriggerUpAudio(): boolean

      Gets the value indicating whether trigger up audio playback is enabled.

      Returns boolean

      true if trigger up audio playback is enabled; otherwise, false.

    • set playTriggerUpAudio(playTriggerUpAudio: boolean): void

      Sets the playTriggerUpAudio behavior and initializes the audio component if necessary.

      Parameters

      • playTriggerUpAudio: boolean

        A boolean indicating whether trigger up audio should be played. If set to true and the audio component is not already created, a new audio component will be instantiated and attached to the scene object.

      Returns void

    • set renderOrder(value: number): void

      Gets the render order of the visual element.

      Parameters

      • value: number

      Returns void

      The render order of the visual element.

    • get shadowPositionOffset(): vec3

      Gets the position offset of the shadow.

      Returns vec3

      The position offset of the shadow.

    • set shadowPositionOffset(value: vec3): void

      Sets the position offset of the shadow.

      Parameters

      • value: vec3

        The position offset of the shadow.

      Returns void

    • get shadowVisual(): DropShadowVisual

      Gets the associated DropShadowVisual instance for this component.

      Returns DropShadowVisual

      The DropShadowVisual instance linked to this component, if any.

    • get size(): vec3

      Gets the size of the visual element.

      Returns vec3

      The size of the visual element.

    • set size(size: vec3): void

      Sets the size of the visual element.

      Parameters

      • size: vec3

        A vec3 representing the dimensions of the visual element.

      Returns void

    • get style(): string

      Gets the style of the visual element.

      Returns string

      The style of the visual element.

    • get text(): string

      Full string in the input

      Returns string

    • set text(text: string): void

      set current text displayed in

      Parameters

      • text: string

      Returns void

    • get textOffset(): vec2

      Returns vec2

      vec2 current text offset override

    • set textOffset(offset: vec2): void

      Parameters

      • offset: vec2

        set current text offset override to "unset" set this to undefined

      Returns void

    • get transform(): Transform

      Gets the transform associated with this element.

      Returns Transform

      The transform of the element.

    • get triggerEndAudioTrack(): AudioTrackAsset

      Gets the audio track to be played at the end of a trigger event.

      Returns AudioTrackAsset

      The audio track asset associated with the trigger end event.

    • set triggerEndAudioTrack(audioTrack: AudioTrackAsset): void

      Sets the audio track to be played at the end of a trigger event.

      Parameters

      Returns void

    • get triggerEndAudioVolume(): number

      Gets the volume level for the trigger end audio.

      Returns number

      The volume level for the trigger end audio.

    • set triggerEndAudioVolume(volume: number): void

      Sets the volume level for the trigger end audio.

      Parameters

      • volume: number

        The desired volume level as a number.

      Returns void

    • get triggerStartAudioTrack(): AudioTrackAsset

      Gets the audio track to be played when the trigger starts.

      Returns AudioTrackAsset

      The audio track asset associated with the trigger start event.

    • set triggerStartAudioTrack(audioTrack: AudioTrackAsset): void

      Sets the audio track to be played when the trigger starts.

      Parameters

      Returns void

    • get triggerStartAudioVolume(): number

      Gets the volume level for the trigger start audio.

      Returns number

      The volume level for the trigger start audio.

    • set triggerStartAudioVolume(volume: number): void

      Sets the volume level for the trigger start audio.

      Parameters

      • volume: number

        The desired audio volume level as a number.

      Returns void

    • get typeString(): string

      Gets the type string of the visual element.

      Returns string

      The type string of the visual element.

    • get visual(): Visual

      Gets the associated Visual instance for this component.

      Returns Visual

      The Visual instance linked to this component.

    • set visual(value: Visual): void

      Sets the associated Visual instance for this component.

      Parameters

      • value: Visual

        The Visual instance to assign.

      Returns void

    Methods

    • Parameters

      • editing: boolean

        start or stop editing

      Returns void

    • Returns vec3

      vec3 of current size

    • function to setup text field call manually if creating dynamically and seeing a frame without the parameters you assign

      Returns void

    • 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

    • Plays the specified audio track at the given volume.

      Parameters

      • audioTrack: AudioTrackAsset

        The audio track asset to be played.

      • volume: number

        The volume level at which the audio track should be played.

      Returns void

    • Registers a tooltip instance with the current component

      Parameters

      • tooltip: Tooltip

        The Tooltip instance to associate with this component.

      Returns void

    • Parameters

      • side: IconSide

        set side of icon and password ui

      Returns void

    • Parameters

      • type: TextInputType

        set type of TextInputField "default", "password", "numeric " or "format"

      Returns void

    • Parameters

      • size: vec3

        vec3 set rendering size

      • setBaseSize: boolean = true

        vec3 overwrite cached starting size

      Returns void

    • Sets the tooltip text for the visual element.

      Parameters

      • text: string

        The text to be displayed in the tooltip.

      Returns void

    • Parameters

      • useIcon: boolean

        turn on whether or not to use the icon note: still requires an icon set to .icon!

      Returns void

    • Parameters

      • text: string

        set current visible text bypasses setting underlying value of this TextInputField

      Returns void

    • Parameters

      Returns void