TimeManager Class
This is the core internal game clock. It manages the elapsed time and calculation of delta values, used for game object motion and tweens.
Constructor
TimeManager
-
game
Parameters:
-
gamePhaser.GameA reference to the currently running game.
Item Index
Methods
elapsedSecondsSince
-
since
How long has passed since the given time (in seconds).
Parameters:
-
sinceNumberThe time you want to measure (in seconds).
Returns:
Duration between given time and now (in seconds).
elapsedSince
-
since
How long has passed since the given time.
Parameters:
-
sinceNumberThe time you want to measure against.
Returns:
The difference between the given time and now.
gamePaused
()
private
Called when the game enters a paused state.
gameResumed
()
private
Called when the game resumes from a paused state.
reset
()
Resets the private _started value to now.
totalElapsedSeconds
()
Number
The number of seconds that have elapsed since the game was started.
Returns:
update
-
raf
Update clock and calculate the fps. This is called automatically by Game._raf
Parameters:
-
rafNumberThe current timestamp, either performance.now or Date.now
Properties
game
Phaser.Game
A reference to the currently running Game.
pausedTime
Number
public
Records how long the game has been paused for. Is reset each time the game pauses.
