diff --git a/example/src/ofApp.cpp b/example/src/ofApp.cpp index b7304b5..3f16b66 100644 --- a/example/src/ofApp.cpp +++ b/example/src/ofApp.cpp @@ -9,6 +9,8 @@ void ofApp::setup() &image.getTextureReference()); gui.setup(triangleSurface); + + bShowInfo = true; } void ofApp::update() @@ -52,6 +54,19 @@ void ofApp::draw() } gui.draw(); + + if ( bShowInfo ) { + // Draw instructions + stringstream ss; + ss << "There are 3 modes:\n\n"; + ss << " 1. Presentation mode\n"; + ss << " 2. Texture mapping mode\n"; + ss << " 3. Projection mapping mode\n\n"; + ss << "You can switch between the modes by using <1>, <2> and <3> keys on the keyboard.\n\n"; + ss << "Hit to hide this message."; + + ofDrawBitmapStringHighlight(ss.str(), 10, 20, ofColor(0,0,0,100), ofColor(255,255,255,200)); + } } void ofApp::keyPressed(int key) @@ -62,6 +77,7 @@ void ofApp::keyPressed(int key) case '1': gui.setMode(ofxSurfaceGui::NONE); break; case '2': gui.setMode(ofxSurfaceGui::TEXTURE_MAPPING); break; case '3': gui.setMode(ofxSurfaceGui::PROJECTION_MAPPING); break; + case 'i': bShowInfo = !bShowInfo; break; default: break; } } diff --git a/example/src/ofApp.h b/example/src/ofApp.h index f8707fe..06cc87c 100644 --- a/example/src/ofApp.h +++ b/example/src/ofApp.h @@ -22,6 +22,7 @@ public: ofImage image; ofxSurfaceGui gui; + bool bShowInfo; }; #endif \ No newline at end of file diff --git a/src/ofxSurfaceGui.cpp b/src/ofxSurfaceGui.cpp index eea1e60..b3b881d 100644 --- a/src/ofxSurfaceGui.cpp +++ b/src/ofxSurfaceGui.cpp @@ -42,10 +42,27 @@ void ofxSurfaceGui::draw() if (mode == NONE) return; if (mode == PROJECTION_MAPPING) { + ofPolyline line; + for ( int i=0; i