View Single Post
  #3  
Old 11-08-2004, 12:33 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

The command viz.pause will freeze all current timers, which can later be resumed with viz.play(). This doesn't stop keyboard and mouse events though. An alternative might look something like this:
Code:
def StopEvents():
	viz.callback(viz.KEYBOARD_EVENT,0)
	viz.callback(viz.TIMER_EVENT,0)
	viz.callback(viz.MOUSEDOWN_EVENT,0)

def ResumeEvents():
	viz.callback(viz.KEYBOARD_EVENT,onkeydown)
	viz.callback(viz.TIMER_EVENT,ontimer)
	viz.callback(viz.MOUSEDOWN_EVENT,onmousedown)
You can then use these functions to freeze/resume input.

To display text to the user you can create a text object like so:
Code:
text = viz.add(viz.TEXT3D,'Thank you for your participation',viz.SCREEN)
#Place in the middle of the screen
text.translate(0.5,0.5)
#Set alignment to center of message
text.alignment(viz.TEXT_CENTER_CENTER)
#Initially hide the text
text.visible(0)
When you want to display the message to the user simply make the text visible.
Reply With Quote