How to use the babylonjs-gui.HolographicButton function in babylonjs-gui

To help you get started, we’ve selected a few babylonjs-gui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brianzinn / react-babylonjs / src / HolographicButton.ts View on Github external
create(scene: Scene): BabylonHolographicButton {
    this.holographicButton = new BabylonHolographicButton(this.props.name)
    this.holographicButton.text = this.props.text

    if (this.props.imageUrl) {
      this.holographicButton.imageUrl = this.props.imageUrl
    }

    if (this.props.onClick) {
      // onPointerClickObservable has some issues...
      this.holographicButton.onPointerDownObservable.add(() => {
        this.props.onClick(this.holographicButton!)
      })
    }

    return this.holographicButton
  }