![]() |
|
#1
|
|||
|
|||
You can use the vizinfo module to display an information box. You can use the viz.MainWindow.worldToScreen command to convert world coordinates to screen coordinates, in order to position the info box near the avatar. Here is some sample code that shows how to accomplish this:
Code:
import viz viz.go() #Create avatar female = viz.add('vcc_female.cfg',euler=(180,0,0),pos=(0,0,6)) #Create info box that is aligned to lower left corner import vizinfo info = vizinfo.add('') info.alignment(vizinfo.LOWER_LEFT) #Setup timer to position info box near avatar head def UpdateInfoPosition(): m = female.getBone('Bip01 Head').getMatrix(viz.AVATAR_WORLD) m.preTrans(0,0.2,0) x,y,z = viz.MainWindow.worldToScreen(m.getPosition()) info.translate(x+0.03,y+0.02) info.visible(z>0) vizact.ontimer(0,UpdateInfoPosition) #Use the following code to change the message of the box info.message('hello') |
#2
|
|||
|
|||
Hello,
Can you please add the code that enables real-time editing to this message box?? Thanks Quote:
|
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
retrieve Object names | Geoffrey | Vizard | 11 | 12-11-2009 04:26 AM |
Child Object Rotation | paulgoldberg | Vizard | 5 | 09-05-2006 11:33 AM |
when collision mode is on, can i "turn it off" for an individual object? | Vdoug | Vizard | 1 | 09-22-2005 12:14 PM |
rotate to object | jargon | Vizard | 1 | 08-08-2005 12:20 PM |
Moving view with object | Xliben | Vizard | 2 | 07-25-2005 05:36 PM |