Skip to content

Instantly share code, notes, and snippets.

@j3ffgray
Created February 19, 2016 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save j3ffgray/c8eaf70c0b0b281e1ebf to your computer and use it in GitHub Desktop.
Save j3ffgray/c8eaf70c0b0b281e1ebf to your computer and use it in GitHub Desktop.
Text Overlay Template, openFrameworks Examples
// 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