Whether the Clock is paused (true
) or active (false
).
When paused, the Clock will not update any of its Timer Events, thus freezing time.
The Scene which owns this Clock.
The time the Clock (and Scene) started, in milliseconds.
This can be compared to the time
parameter passed to a Scene's update
method.
The Scene Systems object of the Scene which owns this Clock.
The scale of the Clock's time delta.
The time delta is the time elapsed between two consecutive frames and influences the speed of time for this Clock and anything which uses it, such as its Timer Events. Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. A value of 0 freezes time and is effectively equivalent to pausing the Clock.
Creates a Timer Event and adds it to the Clock at the start of the frame.
This is a shortcut for #addEvent which can be shorter and is compatible with the syntax of the GreenSock Animation Platform (GSAP).
The delay of the function call, in milliseconds.
The function to call after the delay expires.
Optional
args: any[]The arguments to call the function with.
Optional
callbackScope: anyThe scope (this
object) to call the function with.
Updates the arrays of active and pending Timer Events. Called at the start of the frame.
The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
Removes the given Timer Event, or an array of Timer Events, from this Clock.
The events are removed from all internal lists (active, pending and removal), freeing the event up to be re-used.
The Timer Event, or an array of Timer Events, to remove from this Clock.
Updates the Clock's internal time and all of its Timer Events.
The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.
The current time of the Clock, in milliseconds.
If accessed externally, this is equivalent to the
time
parameter normally passed to a Scene'supdate
method.