Drag[en]gine Script Module DragonScript Script API  1.0
Timer Class Reference
Inheritance diagram for Timer:
DisplayFPSRate.UpdateTimer DisplayVideo.PlaybackTimer RepeatActionTimer Widget.RepeatKeyEventTimer TimerBlock

Public Member Functions

void advance (float elapsed)
void fire ()
float getElapsedTime ()
bool getIsPeriodic ()
float getRemainingTime ()
TimerManager getTimerManager ()
float getTriggerTime ()
void giveUp ()
Timer new (float triggerTime, bool periodic)
Timer new (TimerManager manager, float triggerTime, bool periodic)
void setElapsedTime (float elapsedTime)
void setIsPeriodic (bool periodic)
void setTriggerTime (float triggerTime)

Detailed Description

Describes a timer who will trigger after a given amount of time has elapsed. Can be set as a trigger once timer which will remove itself after having fired or a trigger periodic timer which goes on triggering each time the given amount of time elapsed. A timer always registers with a TimerManager object. If no such object is specified during construction time the default timer manager is used which is a static timer manager.

Member Function Documentation

§ advance()

void advance ( float  elapsed)

Advance timer. If the trigger time is reached fire() is called. If the timer is not periodic it is unregistered from the timer manager. fire() is called after the timer has been removed. This method is called by the timer manager the timer is registered at. Do not call directly unless you implement a timer manager.

§ fire()

void fire ( )

Trigger elapsed. Called after a non periodic timer has been removed from the timer manager.

§ getElapsedTime()

float getElapsedTime ( )

Elapsed seconds.

§ getIsPeriodic()

bool getIsPeriodic ( )

Timer is periodic.

§ getRemainingTime()

float getRemainingTime ( )

Remaining seconds until timer elapses.

§ getTimerManager()

TimerManager getTimerManager ( )

Timer manager the timer is registered at.

§ getTriggerTime()

float getTriggerTime ( )

Seconds until timer elapsed.

§ giveUp()

void giveUp ( )

Give up timer. Call this function if you want to give up a timer not fired yet. Simply dropping the reference does not give it up and the time still triggers after elapsing.

§ new() [1/2]

Timer new ( float  triggerTime,
bool  periodic 

Create timer registering at the default timer manager.

triggerTimeSeconds to wait before triggering
periodicReschedule trigger once finished.

§ new() [2/2]

Timer new ( TimerManager  manager,
float  triggerTime,
bool  periodic 

Create timer registering at timer manager.

managerTimer Manager to register timer at
triggerTimeSeconds to wait before triggering
periodicTrue if this timer is periodic

§ setElapsedTime()

void setElapsedTime ( float  elapsedTime)

Set elapsed seconds.

§ setIsPeriodic()

void setIsPeriodic ( bool  periodic)

Set if timer is periodic.

§ setTriggerTime()

void setTriggerTime ( float  triggerTime)

Set seconds until timer elapses.

The documentation for this class was generated from the following file: