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

Methods

  • getName(): string
  • getNetworkSyncData(): TimerNetworkSyncData
  • getTime(): number
  • Get the time of the timer, in milliseconds.

    Returns number

    The time of the timer, in milliseconds.

  • isPaused(): boolean
  • reset(): 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
  • updateFromNetworkSyncData(syncData: TimerNetworkSyncData): 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