Timer

Inherited: None

Description

The Timer class helps to make your game more smooth and accurate. This class is used in all systems which doing any animation. Using deltaTime() method developers are able to calculate a logic based on delays for example shots or movements of your character. Time scale value can be used for the slow-motion effects because it applied for all deltaTime() values.

Public Methods

None

Static Methods

float

deltaTime ()

float

scale ()

void

setScale (float scale)

float

time ()

Methods Description

float Timer::deltaTime ()

Returns the time in seconds since the last frame.

Note: This value is updated in each frame. In case of calling multiple times in a single frame will return the same result.


float Timer::scale ()

Return the time scale at which the time is passing.

See also setScale().


void Timer::setScale (float scale)

Sets the time scale at which the time is passing.

See also *scale*().


float Timer::time ()

Returns the time in seconds since the start of the game.

Note: This value is updated in each frame. In case of calling multiple times in a single frame will return the same result.