Added osgtext --alignment test to look the effect of calling Text::setAlignent() before and after the Text::setText().

This commit is contained in:
Robert Osfield 2018-04-06 14:06:50 +01:00
parent 0ce3131ffd
commit d1c54223cb

View File

@ -674,6 +674,30 @@ int main(int argc, char** argv)
viewer.setSceneData(text.get());
}
else if (arguments.read("--alignment"))
{
osg::ref_ptr<osg::Group> group = new osg::Group;
{
osg::ref_ptr<osgText::Text> text = new osgText::Text;
text->setFont("fonts/times.ttf");
text->setAxisAlignment(osgText::Text::XZ_PLANE);
text->setAlignment(osgText::Text::RIGHT_TOP);
text->setText("Alingment\nBefore:");
group->addChild(text);
}
{
osg::ref_ptr<osgText::Text> text = new osgText::Text;
text->setFont("fonts/times.ttf");
text->setAxisAlignment(osgText::Text::XZ_PLANE);
text->setText("Alingment\nAfter:");
text->setAlignment(osgText::Text::RIGHT_TOP);
group->addChild(text);
}
viewer.setSceneData(group.get());
}
else if (arguments.read("--mt", numThreads) || arguments.read("--mt"))
{
// construct a multi-threaded text updating test.