Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 12, 2014, 4:08:14 PM (10 years ago)
Author:
aejonas
Message:

health bar is now under the spaceship while moving

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hudHS14/src/modules/overlays/hud/HUDNavigation.cc

    r10110 r10122  
    8282        this->setNavMarkerSize(0.03f);
    8383        this->setAimMarkerSize(0.02f);
     84        this->setHealthMarkerSize(0.08f);
    8485
    8586        this->setDetectionLimit(10000.0f);
     
    116117        XMLPortParam(HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode);
    117118        XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlelement, mode);
     119        XMLPortParam(HUDNavigation, "healthMarkerSize", setHealthMarkerSize, getHealthMarkerSize, xmlelement, mode);
     120
    118121    }
    119122
     
    206209        for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++markerCount, ++listIt)
    207210        {
     211
    208212            std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.find(listIt->first);
    209213            closeEnough = listIt->second < this->detectionLimit_;
     
    273277                    }
    274278                }
     279
     280
    275281
    276282
     
    358364                    // Object is in view
    359365
    360                     // Change material only if outOfView changed
     366
     367
     368
     369
     370
     371                        // Change material only if outOfView changed
    361372                    if (it->second.wasOutOfView_)
    362373                    {
     
    367378
    368379                        //manipulation bzw versuch !!! Jonas
    369                         it->second.health_->setMaterialName(TextureGenerator::getMaterialName("bar2b.png", it->first->getRadarObjectColour()));
     380                        it->second.health_->setMaterialName(TextureGenerator::getMaterialName("bar2.png", it->first->getRadarObjectColour()));
     381                        it->second.health_->setDimensions(this->healthMarkerSize_ * this->getActualSize().x, this->healthMarkerSize_ * this->getActualSize().y);
    370382
    371383                        it->second.wasOutOfView_ = false;
    372384                    }
    373385
     386
     387                    //i need to find the place where the amount of health is saved!!!
     388                    //this->selectedTarget_->getWorldEntity()->
     389
     390
    374391                    // Position health (versuch !!!!)
     392                    it->second.health_->setUV(0.0f, 0.0f, 1.0f, 1.0f);
    375393                    it->second.health_->setLeft((pos.x + 1.0f - it->second.panel_->getWidth()) * 0.5f);
    376394                    it->second.health_->setTop((-pos.y + 1.0f - it->second.panel_->getHeight()) * 0.5f);
     
    431449
    432450            {
    433                 it->second.health_->hide()
     451                it->second.health_->hide();
    434452                it->second.panel_->hide();
    435453                it->second.text_->hide();
     
    487505                        .createOverlayElement("Panel", "HUDNavigation_healthMarker_" + getUniqueNumberString()));
    488506                //panel->setMaterialName("Orxonox/NavTDC");
    489                 health->setMaterialName(TextureGenerator::getMaterialName("bar2b.png", object->getRadarObjectColour()));
     507                health->setMaterialName(TextureGenerator::getMaterialName("bar2.png", object->getRadarObjectColour()));
    490508                health->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);
    491509                //panel->setColour(object->getRadarObjectColour());
     
    519537
    520538        ObjectInfo tempStruct =
    521         {   health, panel, target, text, false, false, false, false};
     539        {   health, panel, target, text, false, false, false};
    522540        this->activeObjectList_[object] = tempStruct;
    523541
Note: See TracChangeset for help on using the changeset viewer.