WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
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:	1936
Size:	24.9 KB
ID:	327  
Reply With Quote
Old 07-15-2009, 05:33 PM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
Have you considered using the vizinfo module? Many of the examples that come with Vizard uses this module to display fixed text on the screen. Search the docs for vizinfo for example code.
Reply With Quote
Old 07-16-2009, 01:36 AM
snoopy78 snoopy78 is offline
Join Date: Jul 2009
Posts: 4
Oh great...

But I've got some questions and can not find information in the tutorials or vizard help.

1) Is it possible to set the textsize of the vizinfo message?

2) How can I set a fixed width and height of the vizinfo field?

3) Can I deactivate the shrink and expand function? These are automatically ON, but I do not know how to switch off.

Many thanks!
Reply With Quote
Old 07-16-2009, 10:23 AM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
The vizinfo box automatically adjusts its size to fit the widht/height of the text. The following code shows how to adjust the text size and disable the expand/shrink icon:
import viz

MESSAGE = """This is my message.
It contains multiple lines.
This is the last line.

import vizinfo
info = vizinfo.add(MESSAGE,textsize=2.0) #Double text size
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Button or Text Chrissy2009 Vizard 1 07-15-2009 05:34 PM
Vizard tech tip: Text to Speech Jeff Vizard 1 01-15-2009 09:39 PM
text output jaclyn.bill Vizard 2 10-24-2007 06:37 AM
adding 2D text via script V.shazzle Vizard 3 09-19-2005 02:45 PM
3d Text with Transparent Borders vjosh Vizard 3 12-01-2004 10:50 AM

All times are GMT -7. The time now is 02:42 AM.

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