View Single Post
Old 04-16-2009, 12:39 PM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
The following example script shows how to specify the size and position of the HTML window. This allows you to place it on the left half of the screen when using side-by-side stereo.
import viz


def ShowHTML():
	#Get current window size
	w,h = viz.window.getSize()
	#Only use left half of window
	w = w * 0.5
	#Set HTML size to 2/3 window size
	width = int(w * 0.667)
	height = int(h * 0.667)
	#Center HTML in window
	x = int((w - width) * 0.5)
	y = int((h - height) * 0.5)

	#Display HTML using custom position and size
vizact.onkeydown(' ',ShowHTML)
Reply With Quote