Options
All
  • Public
  • Public/Protected
  • All
Menu

Manage the timers and times elapsed during last frame, since the beginning of the scene and other time related values. All durations are expressed in milliseconds.

Hierarchy

  • TimeManager

Index

Methods

  • addTimer(name: string): void
  • Parameters

    • name: string

    Returns void

  • getElapsedTime(): number
  • Return the time elapsed since the last call to update (i.e: the last frame), in milliseconds.

    Returns number

  • getTimeFromStart(): number
  • Get the time since the instantiation of the manager (i.e: since the beginning of the scene most of the time), in milliseconds.

    Returns number

  • getTimeScale(): number
  • Get the time scale.

    Returns number

    The time scale (positive, 1 is normal speed).

  • getTimer(name: string): Timer
  • Parameters

    • name: string

    Returns Timer

  • hasTimer(name: string): boolean
  • Parameters

    • name: string

    Returns boolean

  • isFirstFrame(): boolean
  • Return true if update was called only once (i.e: if the scene is rendering its first frame).

    Returns boolean

  • removeTimer(name: string): void
  • Parameters

    • name: string

    Returns void

  • reset(): void
  • Returns void

  • setTimeScale(timeScale: number): void
  • Set the time scale: time will be slower if time scale is < 1, faster if > 1.

    Parameters

    • timeScale: number

      The new time scale (must be positive).

    Returns void

  • update(elapsedTime: number, minimumFPS: number): void
  • Parameters

    • elapsedTime: number
    • minimumFPS: number

    Returns void

Constructors

Generated using TypeDoc