Timer

Simple updatable timer. \ Start with start() and update with update(Deltatime). \ Returns a value between 0 and 1.

Members

Enums

Mode
enum Mode

Change the way Timer behave. \ once: Will run from 0 to 1 in one duration then stop. \ reverse: Will run from 1 to 0 in one duration then stop. \ loop: Will run from 0 to 1 in one duration then restart from 0 again, etc. \ loopReverse: Will run from 1 to 0 in one duration then restart from 1 again, etc. \ bounce: Will run from 0 to 1 in one duration then from 1 to 0, etc. \ bounceReverse: Will run from 1 to 0 in one duration then from 0 to 1, etc.

Functions

pause
void pause()

Interrupts the timer without resetting it.

reset
void reset()

Goes back to starting settings.

resume
void resume()

Resumes the timer from where it was stopped.

start
void start()

Immediatly starts the timer. \ Note that loop and bounce behaviours will never stop until you tell him to.

start
void start(float duration_)

Immediatly starts the timer with the specified running time. \ Note that loop and bounce behaviours will never stop until you tell him to.

stop
void stop()

Immediatly stops the timer and resets it.

update
void update(float deltaTime)

Update with the current deltatime (~1) If you don't call update, the timer won't advance.

Properties

duration
float duration [@property getter]
float duration [@property setter]

Duration in seconds from witch the timer goes from 0 to 1 (framerate dependent). \ Only positive non-null values.

isRunning
bool isRunning [@property getter]

Is the timer currently running ?

mode
Mode mode [@property getter]
Mode mode [@property setter]

Current behavior of the timer.

value
float value [@property getter]

Time elapsed between 0 and the max duration.

value01
float value01 [@property getter]

The relative time elapsed between 0 and 1.

Meta