View Full Version : Display a variable in main graphics window
laker
09-13-2013, 02:21 PM
How can I display the current value of a variable? All I need is something that works like the print statement but prints to the graphics window not the input/output window. Text boxes and dialogue boxes can show content but, as far as I can see, the content can't be a variable - it can only be a text string. Any tips appreciated!
Kevin Chiu
09-16-2013, 05:35 AM
Hi,
As Vizard is Python based, you actually can use Python's function to convert your variable to a string and show it in a text box or dialogue box.
Please try this simple sample:
import viz
viz.go()
a = 10
b = 3
box = viz.addTextbox()
box.setPosition(.5,.5)
box.message(str(a + b))
laker
09-17-2013, 12:56 PM
Thank you Kevin - good of you to take the trouble.
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.