Changeset 2993 for code/trunk/src/orxonox/overlays
- Timestamp:
- May 20, 2009, 12:23:51 AM (16 years ago)
- Location:
- code/trunk/src/orxonox/overlays
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r2896 r2993 57 57 SetConsoleCommand(OrxonoxOverlay, scaleOverlay, false).accessLevel(AccessLevel::User); 58 58 SetConsoleCommand(OrxonoxOverlay, scrollOverlay, false).accessLevel(AccessLevel::User); 59 SetConsoleCommand(OrxonoxOverlay, toggleVisibility, false).accessLevel(AccessLevel::User); 59 60 SetConsoleCommand(OrxonoxOverlay, rotateOverlay, false).accessLevel(AccessLevel::User); 60 61 … … 311 312 /** 312 313 @brief 314 Toggles the visibility of an Overlay by it's name. 315 @param name 316 The name of the overlay defined BaseObject::setName() (usually done with the "name" 317 attribute in the xml file). 318 */ 319 /*static*/ void OrxonoxOverlay::toggleVisibility(const std::string& name) 320 { 321 std::map<std::string, OrxonoxOverlay*>::const_iterator it = overlays_s.find(name); 322 if (it != overlays_s.end()) 323 { 324 OrxonoxOverlay* overlay= (*it).second; 325 if(overlay->isVisible()) 326 overlay->hide(); 327 else 328 overlay->show(); 329 } 330 } 331 332 /** 333 @brief 313 334 Scrolls an overlay by its name. 314 335 @param name -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
r2896 r2993 149 149 //! ConsoleCommand: Accesses the overlay by its name and scrolls it. 150 150 static void scrollOverlay(const std::string& name, const Vector2& scroll); 151 static void toggleVisibility(const std::string& name); 151 152 //! ConsoleCommand: Accesses the overlay by its name and rotates it. 152 153 static void rotateOverlay(const std::string& name, const Degree& angle);
Note: See TracChangeset
for help on using the changeset viewer.