WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:51 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC