Changeset 6880
- Timestamp:
- May 10, 2010, 3:58:08 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.cc
r6875 r6880 251 251 // down 252 252 float position = -pos.x / pos.y + 1.0f; 253 tempRadarViewable->second.first->setPosition((position - tempRadarViewable->second.first->getWidth()) * 0.5f, 1.0f - navMarker_->getHeight());253 tempRadarViewable->second.first->setPosition((position - tempRadarViewable->second.first->getWidth()) * 0.5f, 1.0f - tempRadarViewable->second.first->getHeight()); 254 254 tempRadarViewable->second.first->setUV(0.0f, 0.5f, 0.5f, 1.0f); 255 255 tempRadarViewable->second.second->setLeft((position - textLength) * 0.5f); … … 296 296 } 297 297 298 tempRadarViewable->second.first->show(); 299 tempRadarViewable->second.second->show(); 300 COUT(0) << "ShowGUITest z300" << std::endl; 301 } 298 tempRadarViewable->second.first->show(); 299 tempRadarViewable->second.second->show(); 300 } 302 301 303 302 } … … 360 359 .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberString())); 361 360 362 361 float xScale = this->getActualSize().x; 362 float yScale = this->getActualSize().y; 363 364 panel->setDimensions(navMarkerSize_ * xScale, navMarkerSize_ * yScale); 365 text->setCharHeight(text->getCharHeight() * yScale); 363 366 364 367 activeObjectList_[object] = std::make_pair (panel, text) ; 368 369 this->background_->addChild(panel); 370 this->background_->addChild(text); 365 371 366 372 // background_->addChild(activeObjectList_[object].first); … … 369 375 } 370 376 371 void HUDNavigation::removeObject(RadarViewable* viewable) { 372 assert(activeObjectList_.find(viewable)!=activeObjectList_.end()); 373 activeObjectList_.erase(viewable); 377 void HUDNavigation::removeObject(RadarViewable* viewable) 378 { 379 activeObjectListType::iterator it = activeObjectList_.find(viewable); 380 381 if (activeObjectList_.find(viewable) != activeObjectList_.end()) 382 { 383 // Remove overlays from Ogre 384 this->background_->removeChild(it->second.first->getName()); 385 this->background_->removeChild(it->second.second->getName()); 386 387 activeObjectList_.erase(viewable); 388 } 374 389 } 375 390
Note: See TracChangeset
for help on using the changeset viewer.