Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace HUD

Controls UI elements used while a Scene is played.

Index

Variables

sceneNavigationVisible: boolean

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

Functions

  • showChoicePanel(options: { answer1: string; answer2: string; answer3?: string; answer4?: string; answer5?: string; answer6?: string; question: string; onAnswer?: any }): Disposable
  • 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: { answer1: string; answer2: string; answer3?: string; answer4?: string; answer5?: string; answer6?: string; question: string; onAnswer?: any }
      • Readonly answer1: string
      • Readonly answer2: string
      • Optional Readonly answer3?: string
      • Optional Readonly answer4?: string
      • Optional Readonly answer5?: string
      • Optional Readonly answer6?: string
      • Readonly question: string
      • onAnswer?:function
        • onAnswer(t: number): void
        • Parameters

          • t: number

          Returns void

    Returns Disposable

  • showInfoPanel(options: { image?: string; text: string; title: string; onHide?: any }): Disposable
  • 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: 'yourImageID',
    text: 'This is the body text.',
    onHide: () => Debug.log('Panel closed.'),
    })

    Parameters

    • options: { image?: string; text: string; title: string; onHide?: any }

      panel options

      • Optional Readonly image?: string
      • Readonly text: string
      • Readonly title: string
      • onHide?:function
        • onHide(): void
        • Returns void

    Returns Disposable

    created panel.

  • showQuizPanel(options: { answer1: string; answer2: string; answer3?: string; answer4?: string; answer5?: string; answer6?: string; correctAnswer: number; question: string; onCorrect?: any; onWrong?: any }): Disposable
  • 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: { answer1: string; answer2: string; answer3?: string; answer4?: string; answer5?: string; answer6?: string; correctAnswer: number; question: string; onCorrect?: any; onWrong?: any }

      panel options.

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

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

    Returns Disposable