Options
All
  • Public
  • Public/Protected
  • All
Menu

Module HUD

Namespace for all UI elements that are visible during play mode.

Index

Variables

Let sceneNavigationVisible

sceneNavigationVisible: boolean

Toggles visibility of the Scene navigation at the bottom of the screen.

Functions

showChoicePanel

  • Displays a panel with one question and up to four answers_.

    At least two answers must be defined.

    Example `

    GUI.HUD.showChoicePanel({
        question: 'This is your question.',
        answer1: 'First answer.',
        answer2: 'Second answer.',
        onAnswer: answerIndex => {
            Debug.log(`Answer ${answerIndex} selected!`)
        }
    })

    `

    Parameters

    • options: object
      • answer1: string
      • answer2: string
      • Optional answer3?: string
      • Optional answer4?: string
      • Optional onAnswer?: function
          • (t: number): void
          • Parameters

            • t: number

            Returns void

      • question: string

    Returns Disposable

showInfoPanel

  • Displays a panel with title text, body text and an image via id.

    text and title must be defined.

    Example `

    GUI.HUD.showInfoPanel({
        title: 'This is the title',
        image: "5NwLku5Mcj3F0U05ZgSh5Rof36WGwwwmscVDovR0g1V",
        text: 'This is the body text.',
        onHide: () => Debug.log('Panel closed.'),
    })

    `

    Parameters

    • options: object

      panel options

      • Optional autoRemove?: boolean
        deprecated
      • Optional image?: string
      • Optional onHide?: function
          • (): void
          • Returns void

      • Optional position?: Vector3
        deprecated
      • text: string
      • title: string

    Returns Disposable

    created panel.

showQuizPanel

  • Displays a panel with one question and up to four answers, one of which is correct.

    At least two answers and the correct answer must be defined.

    Example `

    GUI.HUD.showQuizPanel({
        question: 'This is your quiz question.',
        answer1: 'Correct answer.',
        answer2: 'Wrong answer.',
        correctAnswer: 1,
        onCorrect: () => Debug.log('Correct answer selected.'),
        onWrong: () => Debug.log('Wrong answer selected.')
    })

    `

    Parameters

    • options: object

      panel options.

      • answer1: string
      • answer2: string
      • Optional answer3?: string
      • Optional answer4?: string
      • correctAnswer: number
      • Optional onCorrect?: function
          • (): void
          • Returns void

      • Optional onWrong?: function
          • (): void
          • Returns void

      • question: string

    Returns Disposable

Generated using TypeDoc