The [[StandardClock]] implements the requestAnimationFrame browser api to run the tick()




fpsSampler: FpsSampler
tick: ((elapsedMs) => any)

Type declaration

    • (elapsedMs): any
    • Parameters

      • elapsedMs: number

      Returns any


  • Schedule a callback to fire given a timeout in milliseconds using the excalibur [[Clock]]

    This is useful to use over the built in browser setTimeout because callbacks will be tied to the excalibur update clock, instead of browser time, this means that callbacks wont fire if the game is stopped or paused.


    • cb: (() => any)

      callback to fire

        • (): any
        • Returns any

    • timeoutMs: number = 0

      Optionally specify a timeout in milliseconds from now, default is 0ms which means the next possible tick

    Returns void

  • Start the clock, it will then periodically call the tick(elapsedMilliseconds) since the last tick

    Returns void

  • Parameters

    • Optional overrideUpdateMs: number

    Returns void