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

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.

void fire ( )

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

float getElapsedTime ( )

Elapsed seconds.

bool getIsPeriodic ( )

Timer is periodic.

float getRemainingTime ( )

Remaining seconds until timer elapses.

TimerManager getTimerManager ( )

Timer manager the timer is registered at.

float getTriggerTime ( )

Seconds until timer elapsed.

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.

Timer new ( float  triggerTime,
bool  periodic 
)

Create timer registering at the default timer manager.

Parameters
triggerTimeSeconds to wait before triggering
periodicReschedule trigger once finished.
Timer new ( TimerManager  manager,
float  triggerTime,
bool  periodic 
)

Create timer registering at timer manager.

Parameters
managerTimer Manager to register timer at
triggerTimeSeconds to wait before triggering
periodicTrue if this timer is periodic
void setElapsedTime ( float  elapsedTime)

Set elapsed seconds.

void setIsPeriodic ( bool  periodic)

Set if timer is periodic.

void setTriggerTime ( float  triggerTime)

Set seconds until timer elapses.


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