PDA

View Full Version : Horizontal hud to Vertical, help?


BakonGuy
09-17-2010, 10:30 PM
--
I'm trying to make an option for a vertical/horizontal version of the same hud, but I'm not really sure what to change how. Could somebody help me grip the basic concept behind this, doing this really hurts my brain. :eek:

Here's a small snippet of the code.

if ( pWeapon->GetSpriteInactive() )
{
iconWidth = pWeapon->GetSpriteInactive()->Width();
iconHeight = pWeapon->GetSpriteInactive()->Height();

x_offs = (boxWide - iconWidth) / 2;
if ( bSelected && HUDTYPE_CAROUSEL == hud_fastswitch.GetInt() )
{
// place the icon aligned with the non-selected version
y_offs = (boxTall/1.5f - iconHeight) / 2;
}
else
{
y_offs = (boxTall - iconHeight) / 2;
}

if ( !pWeapon->CanBeSelected() )
{
// unselectable weapon, display as such
col = Color(255, 0, 0, col[3]);
}

// draw the inactive version
pWeapon->GetSpriteInactive()->DrawSelf( xpos + x_offs, ypos + y_offs, iconWidth, iconHeight, col );
}

BakonGuy
09-21-2010, 08:36 PM
Edit: Never mind I figured it out, was a lot simpler than I thought. Just making things harder than they are.