WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   about setPosition (https://forum.worldviz.com/showthread.php?t=1356)

xingxing 02-19-2008 09:41 PM

about setPosition
 
I'm trying to use vizinfo and textbox to establish a form. I wanna some textboxes arranged on the vizinfobox on certain positions. e.g. horizontallly, not vertically, ordered. This is hard because the setPosition attribute can only change the position of label of textbox and the position of the input field can't be changed in this way. Can any experts tell me whether I can do it in this way?
If yes, how can I do it?

Regards

xingxing 02-20-2008 02:01 AM

Quote:

Originally Posted by xingxing (Post 5067)
I'm trying to use vizinfo and textbox to establish a form. I wanna some textboxes arranged on the vizinfobox on certain positions. e.g. horizontallly, not vertically, ordered. This is hard because the setPosition attribute can only change the position of label of textbox and the position of the input field can't be changed in this way. Can any experts tell me whether I can do it in this way?
If yes, how can I do it?

Regards

the format I used is like the following.

Tbox = viz.add(viz.TEXTBOX, 'tb')
Tbox.setPosition(.2,.2)

Gladsomebeast 02-20-2008 10:32 AM

I would avoid using the vizinfo feature for detailed control over GUI elements.

Try manualy aranging the gui. Here is some sample code. Because the elements are under the viz.ORTHO parent, there positions are specified in pixels.

Code:

guiRoot = viz.addGroup(parent=viz.ORTHO)
viz.link(viz.CenterTop, guiRoot)

buttonRoot = viz.addGroup(parent=guiRoot, pos=(0, -100, 0))
button = viz.addButton(parent=buttonRoot, pos=(200,0,0), scale=[1]*3)
label = viz.addText('Toggle HUD', parent=button, pos=(-50,25,0), scale=[25]*3)

button = viz.addButton(parent=buttonRoot, pos=(0,0,0), scale=[1]*3)
label = viz.addText('Set Background', parent=button, pos=(-50,25,0), scale=[25]*3)



All times are GMT -7. The time now is 11:35 PM.

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