Shaku

Shaku JS

Back To Table of Content

Game Time

GameTime

Class to hold current game time, both elapse and delta from last frame.

Kind: global class

new GameTime()

create the gametime object with current time.

gameTime.timestamp

Current timestamp

Kind: instance property of GameTime

gameTime.deltaTime

Delta time struct. Contains: milliseconds, seconds.

Kind: instance property of GameTime

gameTime.elapsedTime

Elapsed time struct. Contains: milliseconds, seconds.

Kind: instance property of GameTime

gameTime.delta

Delta time, in seconds, since last frame.

Kind: instance property of GameTime

gameTime.elapsed

Total time, in seconds, since Shaku was initialized.

Kind: instance property of GameTime

gameTime.rawTimestamp

Raw timestamp in milliseconds. This value updates only as long as you run Shaku frames, and continue to update even if game is paused.

Kind: instance property of GameTime

GameTime.rawTimestamp() ⇒ Number

Get raw timestamp in milliseconds. This value updates only as long as you run Shaku frames, and continue to update even if game is paused.

Kind: static method of GameTime
Returns: Number - raw timestamp in milliseconds.

GameTime.reset()

Reset elapsed and delta time.

Kind: static method of GameTime

GameTime.resetDelta()

Reset current frame’s delta time.

Kind: static method of GameTime