diff --git a/src/Application/Application.cpp b/src/Application/Application.cpp index 9e2d44c..29d7363 100644 --- a/src/Application/Application.cpp +++ b/src/Application/Application.cpp @@ -215,6 +215,10 @@ void Application::eraseSurface(int i){ new RmSurfaceCmd(getSurfaceManager(), i)); } +void Application::setInfoText(string text){ + _info.setText(text); +} + void Application::toggleInfo(){ _info.toggle(); } diff --git a/src/Application/Application.h b/src/Application/Application.h index c4ae48f..5483f3e 100644 --- a/src/Application/Application.h +++ b/src/Application/Application.h @@ -57,6 +57,7 @@ class Application : public KeyListener { void addFboSource(FboSource * fboSource); void createSurface(SurfaceType type); void eraseSurface(int i); + void setInfoText(string text); void toggleInfo(); void saveProject(); bool loadXmlSettings(string fileName); diff --git a/src/Info/Info.cpp b/src/Info/Info.cpp index ca2c3d5..d2d00e9 100644 --- a/src/Info/Info.cpp +++ b/src/Info/Info.cpp @@ -5,41 +5,40 @@ namespace piMapper { Info::Info(){ _visible = false; + _text = "There are 4 modes:\n\n" + " 1. Presentation mode\n" + " 2. Texture mapping mode\n" + " - Press \"<\" and \">\" to select previous or next vertex\n" + " - Press to play/pause the video\n" + " 3. Projection mapping mode\n" + " - Press <,> and <.> to select previous or next surface\n" + " - Press \"<\" and \">\" to select previous or next vertex\n" + " - Press to add new triangle surface\n" + " - Press to add new quad surface\n" + " - Press

to toggle perspective warping while quad surface selected\n" + " - Press to add new grid surface\n" + " - Press <[> and <]> to remove or add columns to selected grid surface\n" + " - Press <{> and <}> to remove or add rows to selected grid surface\n" + " - Press <+> and <-> to scale surface up and down\n" + " - Press <9> and <0> to move selected surface one layer up or down\n" + " - Press to hide/show layer panel\n" + " - Press to delete selection\n" + " - Press to play/pause the video\n" + " - Type to clear composition\n" + " 4. Source selection mode\n\n" + + "You can switch between the modes by using <1>, <2>, <3> and <4> " + "keys on the keyboard.\n\n" + + "Press to save the composition\n" + "Press to toggle fullscreen\n" + "Press to undo\n" + "Press to hide this message"; } void Info::draw(){ if(_visible){ - stringstream ss; - ss << "There are 4 modes:\n\n"; - ss << " 1. Presentation mode\n"; - ss << " 2. Texture mapping mode\n"; - ss << " - Press \"<\" and \">\" to select previous or next vertex\n"; - ss << " - Press to play/pause the video\n"; - ss << " 3. Projection mapping mode\n"; - ss << " - Press <,> and <.> to select previous or next surface\n"; - ss << " - Press \"<\" and \">\" to select previous or next vertex\n"; - ss << " - Press to add new triangle surface\n"; - ss << " - Press to add new quad surface\n"; - ss << " - Press

to toggle perspective warping while quad surface selected\n"; - ss << " - Press to add new grid surface\n"; - ss << " - Press <[> and <]> to remove or add columns to selected grid surface\n"; - ss << " - Press <{> and <}> to remove or add rows to selected grid surface\n"; - ss << " - Press <+> and <-> to scale surface up and down\n"; - ss << " - Press <9> and <0> to move selected surface one layer up or down\n"; - ss << " - Press to hide/show layer panel\n"; - ss << " - Press to delete selection\n"; - ss << " - Press to play/pause the video\n"; - ss << " - Type to clear composition\n"; - ss << " 4. Source selection mode\n\n"; - - ss << "You can switch between the modes by using <1>, <2>, <3> and <4> " - "keys on the keyboard.\n\n"; - - ss << "Press to save the composition\n"; - ss << "Press to toggle fullscreen\n"; - ss << "Press to undo\n"; - ss << "Press to hide this message"; - ofDrawBitmapStringHighlight(ss.str(), 10, 20, + ofDrawBitmapStringHighlight(_text, 10, 20, ofColor(0, 0, 0, 100), ofColor(255, 255, 255, 200)); } @@ -49,5 +48,9 @@ void Info::toggle(){ _visible = !_visible; } +void Info::setText(string text){ + _text = text; +} + } // namespace piMapper } // namespace ofx \ No newline at end of file diff --git a/src/Info/Info.h b/src/Info/Info.h index 31dd46d..3fa0dde 100644 --- a/src/Info/Info.h +++ b/src/Info/Info.h @@ -11,9 +11,11 @@ class Info { void draw(); void toggle(); + void setText(string text); private: bool _visible; + string _text; }; } // namespace piMapper diff --git a/src/ofxPiMapper.cpp b/src/ofxPiMapper.cpp index 2d44ede..1d58784 100644 --- a/src/ofxPiMapper.cpp +++ b/src/ofxPiMapper.cpp @@ -154,6 +154,10 @@ unsigned int ofxPiMapper::getNumSurfaces(){ return _application.getSurfaceManager()->getActivePreset()->getSurfaces().size(); } +void ofxPiMapper::setInfoText(string text){ + _application.setInfoText(text); +} + void ofxPiMapper::toggleInfo(){ _application.toggleInfo(); } diff --git a/src/ofxPiMapper.h b/src/ofxPiMapper.h index 20ebcdf..b9959aa 100644 --- a/src/ofxPiMapper.h +++ b/src/ofxPiMapper.h @@ -26,6 +26,7 @@ class ofxPiMapper { void registerFboSource(ofx::piMapper::FboSource * fboSource); // Application + void setInfoText(string text); void toggleInfo(); // Modes