Thread: timer question
View Single Post
  #2  
Old 10-08-2007, 01:12 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You can only register one global callback at a time. You are registering 2 timer callbacks with the following commands:
Code:
viz.callback(viz.TIMER_EVENT,mytimer)
viz.callback(viz.TIMER_EVENT,mytimer2)
The second line will override the first one, so mytimer will never be called. If you want multiple timer callbacks registered at a time you will need to use event classes. Alternatively, you could use the vizact module to register multiple timer callbacks. Example:
Code:
def timer1():
    print 'timer1 elapsed',viz.elapsed()
vizact.ontimer(0,timer1)

def timer2():
    print 'timer2 elapsed',viz.elapsed()
vizact.ontimer(0.5,timer2)
Reply With Quote