View Single Post
Old 07-14-2009, 03:44 AM
snoopy78 snoopy78 is offline
Join Date: Jul 2009
Posts: 4
Question Informationboxes with text

Hi all,

how can I create information boxes, with dynamic created text? (see attachment)

I used this for the box:

def createTextBox(self, textur):
  texture = viz.add(textur)
  texQuad = viz.addTexQuad(align = viz.TEXT_LEFT_TOP, scene=2, pos=1.5,3.3,0], scale=[3,2,0])
and this function for the text:

def createText(self, text, name, fontsize):
  name = viz.addText( text, viz.SCREEN, scene=2)
  name.fontSize( fontsize ) 
  name.translate (0.6, 0.9)
  name.alignment (viz.TEXT_LEFT_TOP)
If I start my application over viz.go(), it's working. But if I use viz.go(viz.FULLSCREEN), then my boxes and the text are not at the same place.

I don't understand, why the box is at the position [1.5, 3.3] and the text at [0.6, 0.9] and in the normal view (not fullscreen), both are at the same position.

Is it possible to set the box and the text at one fixed point from the right side of the window?

The attachment shows my idea...

Thanks a lot for any help!
Attached Thumbnails
Click image for larger version

Name:	box.jpg
Views:	681
Size:	24.9 KB
ID:	327  
Reply With Quote