robertosfield wrote: > Hi Xiangfei, > > On 24 July 2013 05:55, Xiangfei Cui <> wrote: > > > I have a question. > > I create a osgText::Text and set the CharacterSizeMode to SCREEN_COORDS. > > How can I get the pixel length of a string ? > > > > There isn't a specific function for this. The Text drawable has a > getBound() method that returns an osg::BoundingBox that encompasses > the whole text item, would this be sufficient? > > What are you trying to with the pixel length? > > Robert. > _______________________________________________ > osg-users mailing list > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > ------------------ > Post generated by Mail2Forum
I need to show a "legendframe" that contains a lenged and relevant annotations(Text) beside the legend in the window, as the figure shows. The height and width of the "legendframe" are computed automatically according to the annotations. So I need to know the height and width of the annotations. The height is easy to get as it's set by SetCharacterSize, but how could I get the width, e.g. the pixel length of the annotations. Sorry about my poor English and Do I make the question clear ? getBound is available but it produce a incomprehensible result.[/img] ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=55790#55790 Attachments: http://forum.openscenegraph.org//files/qq20130807112838_154.bmp _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

