Trees | Index | Help |
|
---|
Package spyre :: Module spyre :: Class TimeKeeper |
|
object
--+ |Object
--+ | TimeKeeper
Keeps track of time and engine progress. Also has provisions for calling callback functions/bound-methods after predetermined delays. see addDelay()
Does not have reference to engine, so same timekeeper class can track time for entire program, from engine to engine.Method Summary | |
---|---|
Update frame measure. | |
Adds a function to be be executed 'delay' ms later, with arguments 'args'. | |
Startup code to run after other objects are all constructed. | |
Set to only step the engine one frame. | |
Toggle the engine between playing and pausing. | |
Initialize new instance. | |
Exec delayed tasks whose time has arrived, and maintain queue. | |
Enable timekeeper. | |
Turn timer off. | |
Inherited from Object | |
Display the object using OpenGL This method must be overridden. | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Instance Variable Summary | |
---|---|
play : indicates whether update should run this frame, whether interface
hasn't paused engine. |
Class Variable Summary | |
---|---|
Inherited from Object | |
NoneType |
engine : makes engine accessible to displayable objects. |
list |
opengl_state_dependent = []
|
float |
runTime : how long has engine been running? |
int |
runTurn : how many frames have elapsed? |
Method Details |
---|
iterate(self)Update frame measure. Called by engine once per frame. |
addDelay(self, delay, func, args)Adds a function to be be executed 'delay' ms later, with arguments 'args'. These callbacks are synchronized with the framerate, so that each is called at the first frame after delay is complete; Timing granularity depends on frame rate.
|
setup(self, tid)Startup code to run after other objects are all constructed.
|
step(self, count=2)Set to only step the engine one frame. |
toggle(self)Toggle the engine between playing and pausing. |
__init__(self,
fps=24)
Initialize new instance.
|
delayManager(self)Exec delayed tasks whose time has arrived, and maintain queue. |
set_timer(self)Enable timekeeper. |
shutdown(self)Turn timer off. |
Instance Variable Details |
---|
playindicates whether update should run this frame, whether interface hasn't paused engine. |
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sat Jan 07 17:58:16 2006 | http://epydoc.sf.net |