WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Multi-line text node (https://forum.worldviz.com/showthread.php?t=5373)

tokola 06-08-2015 10:53 AM

Multi-line text node
 
Is this possible? I couldn't find a way to insert special characters to a text node (e.g. TAB or RETURN).

Thanks!

Jeff 06-08-2015 11:37 AM

Here's example code that uses the newline character to create multiple lines in a text object:

Code:

import viz
viz.go()

gallery = viz.addChild('gallery.osgb')

text = viz.addText('line 1\nline 2\nline 3',parent=viz.SCREEN,pos=[0.5,0.5,0])
text.alignment(viz.ALIGN_CENTER)


tokola 06-08-2015 01:19 PM

Thanks Jeff. I actually just found it and wanted to post it.
Is there a way to insert other special characters, like TABs?

mape2k 06-10-2015 04:19 AM

Hello tokola,

didn't you asked the exact same question in another thread just a week ago?

There I stated that using "\t" should insert a tab into your string.

Best,
Johannes

tokola 06-10-2015 09:15 AM

I am so sorry. You're absolutely right. I totally forgot about it. I think dementia is on the way:)

I'll probably delete one of the two (if possible) to avoid unnecessary clutter of the forum.


All times are GMT -7. The time now is 12:16 AM.

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