Created
February 19, 2016 23:38
-
-
Save j3ffgray/c8eaf70c0b0b281e1ebf to your computer and use it in GitHub Desktop.
Text Overlay Template, openFrameworks Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in the ofApp.h | |
// ... additional initialization code ... | |
bool bHelpText; | |
// in the ofApp.cpp | |
void ofApp::setup(){ | |
bHelpText = true; | |
// ... additional example code ... | |
} | |
void ofApp::draw(){ | |
// ... additional example code ... | |
if(bHelpText) { | |
stringstream ss; | |
ss << "FPS: " << ofToString(ofGetFrameRate(),0) << endl << endl; | |
ss << "(f): Toggle Fullscreen"<<endl; | |
ss <<"(s): Draw Solid Shapes"<<endl; | |
ss <<"(h): Toggle help."<<endl; | |
ofDrawBitmapString(ss.str().c_str(), 20, 20); | |
} | |
} | |
void ofApp::keyPressed(int key){ | |
switch(key){ | |
case 'h': | |
bHelpText = !bHelpText; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment