![]() |
|
#1
|
|||
|
|||
|
Positioning text with ORTHO parent
I am trying to display some text on a black screen in Vizard. On single screen applications, this is very easy; I just turn the world off and display my text with the screen as the parent, i.e.:
Code:
text1 = viz.addText(txt, parent=viz.SCREEN) Code:
text1 = viz.addText(txt, parent=viz.SCREEN, parent=viz.ORTHO, scene = screen.leftWindow) |
|
#2
|
|||
|
|||
|
You can specify pixel coordinates or link to a window location:
Code:
import viz
viz.go()
#set position in pixel coordinates
text1 = viz.addText('text1',parent=viz.ORTHO)
text1.setScale([100,100,0])
text1.setPosition([300,200,0])
#link to center top
text2 = viz.addText('text2',parent=viz.ORTHO)
text2.setScale([100,100,0])
text2.alignment(viz.ALIGN_CENTER_TOP)
viz.link(viz.CenterTop,text2)
#link to upper left with offset
text3 = viz.addText('text3',parent=viz.ORTHO)
text3.setScale([100,100,0])
text3.alignment(viz.ALIGN_LEFT_TOP)
link = viz.link(viz.LeftTop,text3)
link.setOffset([20,-20,0])
|
|
#3
|
|||
|
|||
|
Ah!
It was pixel coordinates. I was attempting to use the same normalised screen units that worked when I was using viz.SCREEN as the parent so this makes much more sense now. Thanks :-) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Displaying screen text in 3D (Oculus Rift) | pjayaram | Vizard | 2 | 05-27-2014 08:06 PM |
| input from a text file | dig | Vizard | 5 | 10-20-2013 01:20 AM |
| Informationboxes with text | snoopy78 | Vizard | 3 | 07-16-2009 10:23 AM |
| Vizard tech tip: Text to Speech | Jeff | Vizard | 1 | 01-15-2009 09:39 PM |
| 3d Text with Transparent Borders | vjosh | Vizard | 3 | 12-01-2004 10:50 AM |