Hi Guys,<div><br></div><div>I need to create a label, in which to insert a text and an image from .png file.<br></div><div><br></div><div>The label with text ONLY has already been created, as below:</div><div><br></div><div>osg::ref_ptr<osgText::Text> text = new osgText::Text;<br></div><div>text->setText("Tryyyy text");<br></div><div><div>osg::ref_ptr<osg::Geode> textBoat = new osg::Geode;</div><div>textBoat->addDrawable(text);<br></div></div><div><br></div><div>Then, since I have few experience with osg::Image and osg::Text, I tried as solution, to implement a texture inside a StateSet to insert into a Geode,</div><div><br></div><div><div>osg::Texture2D* texture = new osg::Texture2D;</div><div>texture->setDataVariance(osg::Object::DYNAMIC);</div><div>osg::Image* Image=osgDB::readImageFile(std::string(url+"/Images/flags_png/abw.png"));</div><div>texture->setImage(image);</div><div>osg::StateSet* stateTex = new osg::StateSet();</div><div>stateTex->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);</div></div><div>textBoat->setStateSet(stateTex);<br></div><div><br></div><div>Then, the text is correctly created, but I don't have the image.....</div><div><br></div><div>Can anyone show me the right way to go?<br></div><div><br></div><div>Thanks</div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/75b934db-c1f8-423a-8f80-859f508f9a8en%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/75b934db-c1f8-423a-8f80-859f508f9a8en%40googlegroups.com</a>.<br />