Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a timer, which must be updated manually with gdjs.Timer.updateTime.

Hierarchy

  • Timer

Index

Constructors

  • new Timer(name: string): Timer
  • Parameters

    • name: string

      The name of the timer.

    Returns Timer

Methods

  • getName(): string
  • Get the name of the timer

    Returns string

    The name of the timer

  • getTime(): number
  • Get the time of the timer, in milliseconds.

    Returns number

    The time of the timer, in milliseconds.

  • isPaused(): boolean
  • Check if the timer is paused.

    Returns boolean

  • reset(): void
  • Reset the time to zero.

    Returns void

  • setPaused(enable: boolean): void
  • Set if the timer is paused.

    Parameters

    • enable: boolean

      true to pause the timer, false otherwise.

    Returns void

  • setTime(time: number): void
  • Change the time.

    Parameters

    • time: number

      The new time, in milliseconds.

    Returns void

  • updateTime(time: number): void
  • Notify the timer that some time has passed.

    Parameters

    • time: number

      The elapsed time, in milliseconds.

    Returns void

Generated using TypeDoc