#1
|
|||
|
|||
does viz.go() have an antidote?
I am looking for a command: maybe viz.stop()
that simply kills all timers, and "freezes" keyboard/mouse inputs but does not kill the head tracking... right now, I am using an infinite loop, which is by far the least elegant of ways... but it stops the user once thir time is up. Also, is there a way to put a "console" message (something like "Thank you for your participation") in the user's view after their time is up (and the above STOP command has been issued) Thanks! |
#2
|
|||
|
|||
viz.waittime is not much better than an infinite loop
I substituted the infinite loops with the following snippet:
Code:
endLabel.message("Thank you for your participation!")viz.waittime(5) viz.quit() I have had trouble with viz.waititme on other occasions. Can you please explain the correct way to use it or suggest alternative solutions to my problem (see previous post) Thanks again. |
#3
|
|||
|
|||
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) 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) |
#4
|
|||
|
|||
Hi,
viz.waittime should only be used with director functions. If you use the command outside a director function then it affectly freezes the graphics engine for 5 seconds. The following code shows how to accomplish this with director functions: Code:
def DisplayMessageAndQuit(): endLabel.message("Thank you for your participation!") viz.waittime(5) viz.quit() Code:
viz.director(DisplayMessageAndQuit) |
|
|