Module timer
Timer related variables and functions
Functions
reset () | Resets the timer's interval count and length back to 0, and its speed back to 1. |
destroy () | Destroys the timer, freezing its simulated time and disabling its listener. |
Fields
elapsedMS | How many milliseconds have passed within the current interval. |
currentCount | How many intervals have been completed. |
maxCount | How many intervals will be completed. |
interval | How many milliseconds must pass to complete an interval. |
speed | A multiplier applied to the simulated elapsed time. |
destroyed | Whether or not the timer was destroyed. |
usesGameTime | Whether or not the timer uses simulated game time rather than real time / wall clock time. |
Functions
- reset ()
- Resets the timer's interval count and length back to 0, and its speed back to 1.
- destroy ()
- Destroys the timer, freezing its simulated time and disabling its listener.
Fields
- elapsedMS
- How many milliseconds have passed within the current interval.
- currentCount
- How many intervals have been completed.
- maxCount
- How many intervals will be completed. Set to -1 for infinite intervals.
- interval
- How many milliseconds must pass to complete an interval.
- speed
- A multiplier applied to the simulated elapsed time. By default 1. (e.g. a multiplier of 2 makes an interval of 100 milliseconds take only 50 milliseconds to complete)
- destroyed
- Whether or not the timer was destroyed. Calling destroy sets this to true. Read-only.
- usesGameTime
-
Whether or not the timer uses simulated game time rather than real time / wall clock time.
This will be
true
if created by game.newTimer or player.newTimer, orfalse
if created by game.newRealTimer or player.newRealTimer