| 49 | | osg::Node* createLabel2(const osg::Vec3& pos, float size, const std::string& label) |
| 50 | | { |
| 51 | | osg::Geode* geode = new osg::Geode(); |
| 52 | | |
| 53 | | std::string timesFont("fonts/arial.ttf"); |
| 54 | | |
| 55 | | { |
| 56 | | osgText::Text* text = new osgText::Text; |
| 57 | | geode->addDrawable( text ); |
| 58 | | |
| 59 | | text->setFont(timesFont); |
| 60 | | text->setPosition(pos); |
| 61 | | text->setFontResolution(40,40); |
| 62 | | text->setCharacterSize(size); |
| 63 | | text->setCharacterSizeMode(osgText::Text::SCREEN_COORDS); |
| 64 | | text->setAlignment(osgText::Text::CENTER_CENTER); |
| 65 | | text->setAutoRotateToScreen(true); |
| 66 | | text->setDrawMode(osgText::Text::TEXT_PIXMAP); |
| 67 | | text->setText(label); |
| 68 | | |
| 69 | | } |
| 70 | | |
| 71 | | return geode; |
| 72 | | } |