Module vrTimer :: Class vrTimer
[frames] | no frames]

Class vrTimer

   object --+        
            |        
  ??.instance --+    
                |    
vrAEBase.vrAEBase --+
                    |
                   vrTimer

The timer class is responsible to call time based functionality. To use it just create a timer object and connect the callback functionality you need.

Example:

       See also example fade.py, frame.py or menu.py
Instance Methods
 
__init__(interval, singleshot)
The constructor of the vrTimer class.
 
setInterval(interval)
Changes the timer interval.
 
setSingleShot(singleshot)
Changes the singleshot behaviour.

Inherited from vrAEBase.vrAEBase: __reduce__, addLoop, callAllConnected, connect, connectSignal, emitSignal, getModuleName, isActive, loop, recEvent, removeConnections, setActive, setUpdateGUIEnabled, subLoop

Inherited from unreachable.instance: __new__

Class Variables
  __instance_size__ = 144
Method Details

__init__(interval, singleshot)
(Constructor)

 

The constructor of the vrTimer class. Actually there are 3 constructors for this class.

vrTimer() creates a timer callback object that fires repeatedly every render frame.

vrTimer(interval) creates a timer callback object that fires repeatedly in a defined interval.

vrTimer(interval,singleshot) creates a timer callback object that fires in a defined interval.

CAUTION: The timer loop runs synchronous with the render loop, so if your render speed goes down to a few frames per second the timers won't get called more often!

Parameters:
  • interval (float (64bit)) - The interval the timer should fire in seconds. 0.04 (1/25) means 25 times per seconds.
  • singleshot (bool) - Defines if the timer should fire only once (true) or repeatedly (false).
Overrides: vrAEBase.vrAEBase.__init__

setInterval(interval)

 

Changes the timer interval.

CAUTION: If the object was a singleshot timer and has already fired you need to call addLoop to put it back into the behavior loop.

Parameters:
  • interval (float (64bit)) - The interval in seconds.

setSingleShot(singleshot)

 

Changes the singleshot behaviour.

CAUTION: If the object was a singleshot timer and has already fired you need to call addLoop to put it back into the behavior loop.

Parameters:
  • singleshot (bool) - True for a single timer event and false for repeated timer events.