Drag[en]gine Script Module DragonScript
1.21
|
Timer triggered after a specific amount of time elapsed. More...
Public Member Functions | |
void | advance (float elapsed) |
Advance timer. More... | |
void | fire () |
Timer time elapsed. More... | |
float | getElapsedTime () |
Elapsed seconds. More... | |
bool | getIsPeriodic () |
Timer is periodic. More... | |
float | getRemainingTime () |
Remaining seconds until timer elapses. More... | |
TimerManager | getTimerManager () |
Timer manager the timer is registered at. More... | |
float | getTriggerTime () |
Seconds until timer elapsed. More... | |
void | giveUp () |
Give up timer if registered with a timer manager. More... | |
bool | hasElapsed () |
Timer elapsed. More... | |
Timer | new (float triggerTime, bool periodic) |
Create timer registered at default timer manager. More... | |
Timer | new (TimerManager manager, float triggerTime, bool periodic) |
Create timer registered at timer manager. More... | |
void | setElapsedTime (float elapsedTime) |
Set elapsed seconds. More... | |
void | setIsPeriodic (bool periodic) |
Set if timer is periodic. More... | |
void | setTriggerTime (float triggerTime) |
Set seconds until timer elapses. More... | |
Public Attributes | |
float | pElapsedTime |
bool | pIsPeriodic |
TimerManager | pTimerManager |
float | pTriggerTime |
Timer triggered after a specific amount of time 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.
void Dragengine.Utils.Timer.advance | ( | float | elapsed | ) |
Advance timer.
If elapsed time reaches 0 fire() is called. If the timer is not periodic it is unregistered from timer manager. fire() is called after the timer has been removed. If timer is periodic the timer is rescheduled with the trigger time. This makes periodic timers not well suited for precise timing purpose at small update intervals. If you need this kind of precise timing use FrameUpdateListener and track elapsed time directly.
void Dragengine.Utils.Timer.fire | ( | ) |
Timer time elapsed.
Reimplemented in Dragengine.Utils.TimerBlock, Dragengine.Gui.Widget.RepeatKeyEventTimer, Dragengine.Gui.RepeatActionTimer, Dragengine.Gui.ShoutConsole.UpdateTimer, Dragengine.Gui.MousePointers.VideoMousePointer.PlaybackTimer, Dragengine.Gui.ClickedActionListener.ResetMultiClickTimer, and Dragengine.Gui.DisplayFPSRate.UpdateTimer.
float Dragengine.Utils.Timer.getElapsedTime | ( | ) |
Elapsed seconds.
bool Dragengine.Utils.Timer.getIsPeriodic | ( | ) |
Timer is periodic.
float Dragengine.Utils.Timer.getRemainingTime | ( | ) |
Remaining seconds until timer elapses.
TimerManager Dragengine.Utils.Timer.getTimerManager | ( | ) |
Timer manager the timer is registered at.
float Dragengine.Utils.Timer.getTriggerTime | ( | ) |
Seconds until timer elapsed.
void Dragengine.Utils.Timer.giveUp | ( | ) |
Give up timer if registered with a timer manager.
Call to give up pending timer. Dropping the reference alone does not give up the timer.
Reimplemented in Dragengine.Utils.TimerBlock.
bool Dragengine.Utils.Timer.hasElapsed | ( | ) |
Timer Dragengine.Utils.Timer.new | ( | float | triggerTime, |
bool | periodic | ||
) |
Create timer registered at default timer manager.
triggerTime | Seconds to wait before triggering |
periodic | Reschedule trigger once finished. |
Timer Dragengine.Utils.Timer.new | ( | TimerManager | manager, |
float | triggerTime, | ||
bool | periodic | ||
) |
Create timer registered at timer manager.
manager | Timer Manager to register timer at |
triggerTime | Seconds to wait before triggering |
periodic | True if this timer is periodic |
void Dragengine.Utils.Timer.setElapsedTime | ( | float | elapsedTime | ) |
Set elapsed seconds.
void Dragengine.Utils.Timer.setIsPeriodic | ( | bool | periodic | ) |
Set if timer is periodic.
void Dragengine.Utils.Timer.setTriggerTime | ( | float | triggerTime | ) |
Set seconds until timer elapses.
float Dragengine.Utils.Timer.pElapsedTime |
bool Dragengine.Utils.Timer.pIsPeriodic |
TimerManager Dragengine.Utils.Timer.pTimerManager |
float Dragengine.Utils.Timer.pTriggerTime |