WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   adding 2D text via script (https://forum.worldviz.com/showthread.php?t=416)

V.shazzle 09-19-2005 12:54 PM

adding 2D text via script
 
In Vizard 2.53, what is the script equivalent of using 'Add Text' in the Resource box?

ie. 'Add Text' -> text name is 'sample text' - how would I do that in code?


thanks!

farshizzo 09-19-2005 02:04 PM

Hi,

Here is sample code to add a text object to the screen.
Code:

MyText = viz.add(viz.TEXT3D,'Message',viz.SCREEN)
MyText.translate(0.5,0.5)


V.shazzle 09-19-2005 02:31 PM

is there a way to add 2D text label or text that sticks to one positon on the screen regardless of the viewpoint?

for example: in Beginner's Tutorials - adding 2D and 3D text - Stuck to the world: 'White Text' stays in place while 'Yellow Text' moves around due to viewpoint change. How do I add something like 'White Text' via scripts?

farshizzo 09-19-2005 02:45 PM

The code in the previous post does just that. It adds a text object to the screen, then translates it to the center. The text will stay in the same place on screen, no matter where the viewpoint is.


All times are GMT -7. The time now is 06:38 AM.

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