Font

Der Font welcher im Text gebraucht werden soll ist ein Node. Dieser muss zuerst initialisiert, definiert und im SceneGraph integriert werden:
SoFont *myfont = new SoFont;
myfont->name.setValue("Helvetica-Bold");
myfont->size.setValue(32.0);
root->addChild(myfont);

2D-Text

2D Text bleibt immer flach auf dem Bildschirm und verändert seine Grösse nicht, nur die Position kann sich ändern.
SoText2 *mytext = new SoText2;
mytext->string.setValue("This is my text");
mytext->spacing.setValue(2.5);
mytext->justification.setValue(SoText2::CENTER);
root->addChild(mytext);


3D-Text

SoText3 *mytext = new SoText3;
mytext->string.setValue("This is my text");
mytext->spacing.setValue(1);
mytext->justification.setValue(SoText3::LEFT);
mytext->parts.setValue(SoText3::SIDES);
root->addChild(mytext);



Header-Files:
#include <Inventor/nodes/SoFont.h>
#include <Inventor/nodes/SoText2.h>
#include <Inventor/nodes/SoText3.h>

































































This website has been archived and is no longer maintained.