Changeset 1141
- Timestamp:
- Apr 22, 2008, 10:20:40 PM (17 years ago)
- Location:
- code/branches/console/src/orxonox/console
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/orxonox/console/InGameConsole.cc
r1139 r1141 89 89 // for the beginning, don't scroll 90 90 scroll = 0; 91 scrollTimer = 0; 91 92 cursor = 0; 92 93 // create overlay and elements … … 151 152 */ 152 153 void InGameConsole::tick(float dt){ 153 float top = consoleOverlayContainer->getTop(); 154 if(scroll!=0){ 155 top = top + 0.02*scroll; 156 consoleOverlayContainer->setTop(top); 157 } 158 if(top <= -1.2*REL_HEIGHT){ 159 // window has completely scrolled up 160 scroll = 0; 161 consoleOverlay->hide(); 162 active = false; 163 } 164 if(top >= 0){ 165 // window has completely scrolled down 166 scroll = 0; 167 consoleOverlayContainer->setTop(0); 168 active = true; 154 scrollTimer += dt; 155 if(scrollTimer >= 0.01){ 156 float top = consoleOverlayContainer->getTop(); 157 scrollTimer = 0; 158 if(scroll!=0){ 159 // scroll 160 top = top + 0.02*scroll; 161 consoleOverlayContainer->setTop(top); 162 } 163 if(top <= -1.2*REL_HEIGHT){ 164 // window has completely scrolled up 165 scroll = 0; 166 consoleOverlay->hide(); 167 active = false; 168 } 169 if(top >= 0){ 170 // window has completely scrolled down 171 scroll = 0; 172 consoleOverlayContainer->setTop(0); 173 active = true; 174 } 169 175 } 170 176 -
code/branches/console/src/orxonox/console/InGameConsole.h
r1139 r1141 74 74 int windowH; 75 75 int scroll; 76 float scrollTimer; 76 77 float cursor; 77 78 bool active;
Note: See TracChangeset
for help on using the changeset viewer.