View Single Post
  #1  
Old 11-12-2013, 05:18 PM
saajaja saajaja is offline
Member
 
Join Date: Nov 2011
Posts: 14
Blindfolding screen, asking for input, unblindfolding.

Hello, and thank you for reading. Here is what I am trying to do:

1. Turn the screen black.
2. Display a popup dialog which asks for an input.
3. Turn the world back on.

Here is some code that should do that when you press the spacebar:

Code:
import viz
import vizinput
import vizact

piazza = viz.add('piazza.osgb')
viz.go()

def getInput():
	# Blindfold. This isn't working.
	viz.MainScene.visible(0,viz.WORLD)
	viz.clearcolor(viz.SKYBLUE)

	# Ask for input
	input = ''
	while input == '':
		input = vizinput.input('Input something.')

	# Unblindfold
	viz.MainScene.visible(1,viz.WORLD)
	viz.clearcolor(viz.BLACK)
	
vizact.onkeydown(' ', getInput)
However, it does not do that. Instead, it does this:
1. Ask for input.

Help would be greatly appreciated. Thank you for reading.
Reply With Quote