Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: LocalTimer

[13:7] extends: FxObj

Wraps FXGL's LocalTimer, a one-shot stopwatch built from Timer .newLocalTimer. capture records the current time; elapsed returns true once a given Duration has passed since the last capture. Useful for cool-down counters and frame-budget gating.

Methods

  • LocalTimer ()

    Empty default constructor; populated by Timer.newLocalTimer.

  • capture ()

    Records the current time as the reference point for the next elapsed call.

    • @r this object
  • elapsed (double Seconds)

    Returns true if Seconds or more have passed since the last capture.

    • @p Seconds is the threshold in seconds.
    • @r A bool.