Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TouchButton3D

Class used to create a touchable button in 3D

Hierarchy

Implements

Index

Constructors

constructor

  • Creates a new touchable button

    Parameters

    • Optional name: string

      defines the control name

    • Optional collisionMesh: Mesh

      mesh to track collisions with

    Returns TouchButton3D

Properties

Optional nameSearch playground for name

name: string | undefined

Defines the control name

onPointerClickObservableSearch playground for onPointerClickObservable

onPointerClickObservable: Observable<Vector3WithInfo>

An event triggered when a control is clicked on (with a mouse)

onPointerDownObservableSearch playground for onPointerDownObservable

onPointerDownObservable: Observable<Vector3WithInfo>

An event triggered when the pointer taps the control

onPointerEnterObservableSearch playground for onPointerEnterObservable

onPointerEnterObservable: Observable<Control3D>

An event triggered when pointer enters the control

onPointerMoveObservableSearch playground for onPointerMoveObservable

onPointerMoveObservable: Observable<Vector3>

An event triggered when the pointer moves over the control

onPointerOutObservableSearch playground for onPointerOutObservable

onPointerOutObservable: Observable<Control3D>

An event triggered when the pointer moves out of the control

onPointerUpObservableSearch playground for onPointerUpObservable

onPointerUpObservable: Observable<Vector3WithInfo>

An event triggered when pointer is up

onToggleObservableSearch playground for onToggleObservable

onToggleObservable: Observable<boolean>

An event triggered when the button is toggled. Only fired if 'isToggleButton' is true

parentSearch playground for parent

Gets or sets the parent container

pointerDownAnimationSearch playground for pointerDownAnimation

pointerDownAnimation: () => void

Callback used to start pointer down animation

Type declaration

    • (): void
    • Returns void

pointerEnterAnimationSearch playground for pointerEnterAnimation

pointerEnterAnimation: () => void

Callback used to start pointer enter animation

Type declaration

    • (): void
    • Returns void

pointerOutAnimationSearch playground for pointerOutAnimation

pointerOutAnimation: () => void

Callback used to start pointer out animation

Type declaration

    • (): void
    • Returns void

pointerUpAnimationSearch playground for pointerUpAnimation

pointerUpAnimation: () => void

Callback used to start pointer up animation

Type declaration

    • (): void
    • Returns void

Accessors

behaviors

collidableFrontDirection

  • get collidableFrontDirection(): Vector3
  • set collidableFrontDirection(frontWorldDir: Vector3): any
  • Returns the front-facing direction of the button, or BABYLON.Vector3.Zero if there is no 'front'

    Returns Vector3

  • Sets the front-facing direction of the button. Pass in BABYLON.Vector3.Zero to allow interactions from any direction

    Parameters

    • frontWorldDir: Vector3

      the forward direction of the button

    Returns any

collisionMesh

  • set collisionMesh(collisionMesh: Mesh): any
  • Sets the mesh used for testing input collision

    Parameters

    • collisionMesh: Mesh

      the new collision mesh for the button

    Returns any

content

  • Gets or sets the GUI 2D content used to display the button's facade

    Returns Control

  • Gets or sets the GUI 2D content used to display the button's facade

    Parameters

    Returns any

contentResolution

  • get contentResolution(): number
  • set contentResolution(value: number): any
  • Gets or sets the texture resolution used to render content (512 by default)

    Returns number

  • Gets or sets the texture resolution used to render content (512 by default)

    Parameters

    • value: number

    Returns any

isActiveNearInteraction

  • get isActiveNearInteraction(): boolean
  • Whether the current interaction is caused by near interaction or not

    Returns boolean

isToggleButton

  • get isToggleButton(): boolean
  • set isToggleButton(value: boolean): any
  • Setter for if this TouchButton3D should be treated as a toggle button

    Returns boolean

  • Setter for if this TouchButton3D should be treated as a toggle button

    Parameters

    • value: boolean

      If this TouchHolographicButton should act like a toggle button

    Returns any

isToggled

  • get isToggled(): boolean
  • set isToggled(newState: boolean): any
  • A public entrypoint to set the toggle state of the TouchHolographicButton. Only works if 'isToggleButton' is true

    Returns boolean

  • A public entrypoint to set the toggle state of the TouchHolographicButton. Only works if 'isToggleButton' is true

    Parameters

    • newState: boolean

      The new state to set the TouchHolographicButton's toggle state to

    Returns any

isVisible

  • get isVisible(): boolean
  • set isVisible(value: boolean): any
  • Gets or sets a boolean indicating if the control is visible

    Returns boolean

  • Gets or sets a boolean indicating if the control is visible

    Parameters

    • value: boolean

    Returns any

mesh

node

position

  • Gets or sets the control position in world space

    Returns Vector3

  • Gets or sets the control position in world space

    Parameters

    Returns any

scaling

  • Gets or sets the control scaling in world space

    Returns Vector3

  • Gets or sets the control scaling in world space

    Parameters

    Returns any

typeName

  • get typeName(): string
  • Gets a string representing the class name

    Returns string

Methods

_prepareNodeSearch playground for _prepareNode

  • _prepareNode(scene: Scene): void

addBehaviorSearch playground for addBehavior

disposeSearch playground for dispose

  • dispose(): void

getBehaviorByNameSearch playground for getBehaviorByName

getClassNameSearch playground for getClassName

  • getClassName(): string
  • Get the current class name of the control.

    Returns string

    current class name

getPressDepthSearch playground for getPressDepth

  • getPressDepth(touchPoint: Vector3): number
  • Get the height of the touchPoint from the collidable part of the button

    Parameters

    • touchPoint: Vector3

      the point to compare to the button, in absolute position

    Returns number

    the depth of the touch point into the front of the button

linkToTransformNodeSearch playground for linkToTransformNode

removeBehaviorSearch playground for removeBehavior

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Static property
  • Static method