text derived from ygGeometry | Example | Source | Header |
Messages |
string | string | set text string to be generated |
color | four floats | set the color of the text |
font | string, [filled | extruded | textured | outlined] | set the font and optional style |
justify | [left | center | right] | set the font justification |
Events |
changed | width | the width of the text has changed |
Comments |
constructor text
1pfMaterial* mat = new pfMaterial; mat->setSide(PFMTL_BOTH); mat->setColorMode(PFMTL_BOTH,PFMTL_CMODE_OFF); mat->setColor(PFMTL_EMISSION,1,0,0); gstate = new pfGeoState; gstate->setAttr(PFSTATE_FRONTMTL,mat); gstate->setAttr(PFSTATE_BACKMTL,mat); string->setGState(gstate);
2 set draw mask
3 set intersection traversal mask
destructor ~text
method reset
1 set default font to "Times-Elfin"
2 set default style to extruded
3 set color to (0,0,0,1)
method message
1 set text string to be generated
1.12 set the color of the textfor (int i=0; igetStringLength(); i++) { pfGeoSet* chr = (pfGeoSet*)string->getCharGSet(i); if (chr) chr->setGState(gstate); }
3 set the font and optional style
4 set the font justification
method app
0.1 the width of the text has changed