Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 6, 2018, 2:11:17 AM (7 years ago)
Author:
landauf
Message:

[HUD_HS16] fixed bug with the position of the hud pickup items

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/overlays/hud/HUDPickupSystem.cc

    r11702 r11703  
    7979
    8080        //add to local map and place on screen
    81         int i = 0;
    8281        const float offsetX = 0.345f;
    83         float offsetY = 0.82f;
     82        const float offsetY = 0.82f;
    8483        const float x = 0.102f;
     84        const float y = 0.075f;
    8585
    8686        for(Pickupable* pickup:p)
    8787        {
    88             i=indexes_.find(pickup)->second;
    89             //second row has offset
    90             if(i==5)
    91             {   
    92                 i=0;
    93                 offsetY+=0.075f;
    94             }
     88            int index = indexes_.find(pickup)->second;
     89            int row = index / 5;
     90            int column = index % 5;
    9591
    9692            HUDPickupItem* item = new HUDPickupItem(this->getContext());
    97             item->initializeMaterial(this->getIcon(((Pickup*)pickup)->getRepresentationName()), offsetX+i*x, offsetY);
     93            item->initializeMaterial(this->getIcon(((Pickup*)pickup)->getRepresentationName()), offsetX+column*x, offsetY+row*y);
    9894            item->setOverlayGroup(this->getOverlayGroup());
    9995            items_.push_back(item);
Note: See TracChangeset for help on using the changeset viewer.