jetlag2d
    Preparing search index...

    Class TimedEvent

    TimedEvent is an action that needs to happen after some amount of time has passed.

    Index
    • Create a TimedEvent that can be scheduled to run in the future.

      Parameters

      • interval: number

        The time between event executions, in seconds

      • repeat: boolean

        Should this event repeat?

      • action: () => void

        The action to perform when time is up

      Returns TimedEvent

    cancelled: boolean = false

    Has the event been explicitly cancelled

    • Act as if an additional elapsedMs have transpired.

      Adding a large number (more than the internal msUntilNext) will not cause the event to fire twice. It also will not cause the event to fire immediately... the event will be run on the next iteration of the render loop.

      This can be useful if you want the time spent on a PauseScene to count toward in-game time.

      Parameters

      • elapsed: number

        How many more seconds have transpired. Can be negative to delay when the next timer event happens.

      Returns void