View Single Post
  #2  
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.
Code:
import viz
viz.go(viz.STEREO)

viz.add('gallery.ive')

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
	viz.window.displayHTML('http://www.google.com',pos=[x,y],size=[width,height])
	
vizact.onkeydown(' ',ShowHTML)
Reply With Quote