Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Application

Manages application, ViewMode and Scene states.

Index

Type Aliases

ViewMode: "default" | "gyro" | "vr" | "ar"

The viewing mode used in this Scene.

Supported modes

  • default - Normal display mode
  • gyro - Gyroscope controlled camera
  • vr - Stereoscopic projection (including VR controllers, if available)
  • ar - AR projection

Note: Entering vr or ar mode restarts the Scene.

Variables

isMobile: boolean

Returns true if this Scene runs on a tablet or mobile phone.

deprecated

replaced with Device.isMobile

isTablet: boolean

Returns true if this Scene runs on a tablet.

deprecated

replaced with Device.isTablet

viewMode: ViewMode

Defines the current ViewMode of this Scene.

Functions

  • Defines the onExit handler which triggers before this Scene is ended.

    Note: This method can be called multiple times to call additional functions on scene exit.

    Parameters

    • onExit: (() => void)

      function to call when Scene ends.

        • (): void
        • Returns void

    Returns Disposable

  • onSceneSwitch(handler: ((t: number) => void)): Disposable
  • Defines the onSceneSwitch handler which triggers before this Scene changes to another.

    Note: This method can be called multiple times to call additional functions on scene switch.

    Parameters

    • handler: ((t: number) => void)

      function to call when Scene switches. Provides an index parameter for the target Scene

        • (t: number): void
        • Parameters

          • t: number

          Returns void

    Returns Disposable

  • Defines an onStart handler which triggers once when the application starts.

    Note: This method can be called multiple times to call additional functions on start of the application.

    Parameters

    • handler: (() => void)

      function to call once on start of application.

        • (): void
        • Returns void

    Returns Disposable

  • quit(): void
  • quit(imageId: string): void
  • Closes this Space and returns the user to the previous screen.

    deprecated

    Returns void

  • Closes this Space and returns the user to the previous screen.

    deprecated

    Parameters

    • imageId: string

      image shown on play screen.

    Returns void

  • resetScene(): void
  • Resets this Scene to its starting state.

    Note: Scripts of this Scene do not restart.

    Returns void

  • restartScene(): void
  • Disposes changes done to this Scene and restarts scripts.

    Returns void