<div dir="ltr"><div dir="ltr">If you will be dynamically changing your text, then specify that when you first create it:<div><font face="monospace, monospace"> osgText::Text* text = new osgText::Text;</font></div><div><font face="monospace, monospace"> text->setDataVariance(osg::Object::DYNAMIC);</font></div><div><div>Note that setting the data variance is<a href="http://forum.openscenegraph.org/viewtopic.php?t=10441&view=next"> important for multithreaded Viewers</a>.</div><div><br></div><div>Then you can change the text easily:</div><div><font face="monospace, monospace"> text->setText("insert dynamically-generated string here");</font></div><div><br></div><div>You can show/hide the text with its node mask:</div><div><font face="monospace, monospace"> text->setNodeMask(0x0); // NodeMask = 0 to hide</font></div><div><font face="monospace, monospace"> text->setNodeMask(~0x0); // NodeMask = 0xffffffff to show</font></div><div><br></div><div>Hope that helps,</div><div>Ravi</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 20, 2018 at 8:39 AM Diego Mancilla <<a href="mailto:dmancillac@gmail.com">dmancillac@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I have a couple of doubts regarding the proper way of handling osg::Text inside an animation.<br>
<br>
For the sake of simplicity lets say we are working on the osganimate example, and we have multiple cessna moving around.<br>
<br>
1- What is the proper way of changing the text of osg::Text on runtime? For instance, if I want to display current position of cessna.<br>
<br>
2- How can I hide/show the current value of the text on user request (stoke of key for example). <br>
<br>
Thank you!<br>
<br>
Cheers,<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=75329#75329" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=75329#75329</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div></div>