Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- testapp.cpp
- void testApp::setup(){
- font.loadFont("mentone-semibol.otf",35,true,true,true);
- text=nodeString("Hello world");
- text.setPosition(ofGetWidth()/2, ofGetHeight()/2,0);
- //ofSetFrameRate(60);
- }
- void testApp::draw(){
- text.draw(font, ofColor(0,128,0));
- ofSetColor(0);
- font.drawString(ofToString(ofGetFrameRate(),2),50,50);
- }
- nodestring.cpp
- void nodeString::draw(ofTrueTypeFont font, ofColor c)
- {
- //m is a ofmesh
- m=font.getStringMesh(text,0,0);
- texture=font.getFontTexture();
- //save wold matrix
- ofPushMatrix();
- //translate to desired position
- ofTranslate(this->getX(),this->getY(), this->getZ());
- //scale
- ofScale(this->getScale().x,this->getScale().y,this->getScale().z);
- //rotate
- //ofRotate(ofGetElapsedTimef()*50,1,0,0);
- ofSetColor(c);
- //m.enableTextures();
- texture.bind();
- m.draw();
- texture.unbind();
- ofPopMatrix();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement