本文整理汇总了C++中HUD::addChild方法的典型用法代码示例。如果您正苦于以下问题:C++ HUD::addChild方法的具体用法?C++ HUD::addChild怎么用?C++ HUD::addChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HUD
的用法示例。
在下文中一共展示了HUD::addChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createText
osg::Group* createText(void)
{
osg::Group* localNode = new osg::Group();
localNode->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
HUD* hud = new HUD();
localNode->addChild(hud);
text = new osgText::Text();
text->setText(textStr);
text->setAxisAlignment(osgText::Text::SCREEN);
text->setPosition(osg::Vec3(20.0, 1150.0, 0.0));
text->setCharacterSize(30.0);
text->setFont("../../models/arial.ttf");
text->setColor(osg::Vec4(1.0, 1.0, 0.0, 0.8));
text->setDataVariance(osgText::Text::DYNAMIC);
text2 = new osgText::Text();
text2->setText(textStr2);
text2->setAxisAlignment(osgText::Text::SCREEN);
text2->setPosition(osg::Vec3(20.0, 1100.0, 0.0));
text2->setCharacterSize(30.0);
text2->setFont("../../models/arial.ttf");
text2->setColor(osg::Vec4(1.0, 1.0, 0.0, 0.8));
text2->setDataVariance(osgText::Text::DYNAMIC);
text3 = new osgText::Text();
text3->setText(textStr3);
text3->setAxisAlignment(osgText::Text::SCREEN);
text3->setPosition(osg::Vec3(20.0, 1050.0, 0.0));
text3->setCharacterSize(30.0);
text3->setFont("../../models/arial.ttf");
text3->setColor(osg::Vec4(1.0, 1.0, 0.0, 0.8));
text3->setDataVariance(osgText::Text::DYNAMIC);
text4 = new osgText::Text();
text4->setText(textStr4);
text4->setAxisAlignment(osgText::Text::SCREEN);
text4->setPosition(osg::Vec3(20.0, 1000.0, 0.0));
text4->setCharacterSize(30.0);
text4->setFont("../../models/arial.ttf");
text4->setColor(osg::Vec4(1.0, 1.0, 0.0, 0.8));
text4->setDataVariance(osgText::Text::DYNAMIC);
text5 = new osgText::Text();
text5->setText(textStr5);
text5->setAxisAlignment(osgText::Text::SCREEN);
text5->setPosition(osg::Vec3(20.0, 950.0, 0.0));
text5->setCharacterSize(30.0);
text5->setFont("../../models/arial.ttf");
text5->setColor(osg::Vec4(1.0, 1.0, 0.0, 0.8));
text5->setDataVariance(osgText::Text::DYNAMIC);
text6 = new osgText::Text();
text6->setText(textStr6);
text6->setAxisAlignment(osgText::Text::SCREEN);
text6->setPosition(osg::Vec3(250.0, 950.0, 0.0));
text6->setCharacterSize(30.0);
text6->setFont("../../models/arial.ttf");
text6->setColor(osg::Vec4(1.0, 1.0, 0.0, 0.8));
text6->setDataVariance(osgText::Text::DYNAMIC);
osg::ref_ptr<osg::Group> textGroup = new osg::Group();
osg::ref_ptr<osg::Geode> textGeode = new osg::Geode();
textGeode->addDrawable(text);
textGeode->addDrawable(text2);
textGeode->addDrawable(text3);
textGeode->addDrawable(text4);
textGeode->addDrawable(text5);
textGeode->addDrawable(text6);
textGroup->addChild(textGeode);
hud->addChild(textGroup);
return localNode;
}