Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding

Reply
 
Thread Tools Display Modes
Old 09-17-2010, 09:30 PM   #1
BakonGuy
 
 
 
Join Date: Jul 2009
Reputation: 9
Posts: 278
Horizontal hud to Vertical, help?

--
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.

Here's a small snippet of the code.

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 is offline  
Reply With Quote
Old 09-21-2010, 07:36 PM   #2
BakonGuy
 
 
 
Join Date: Jul 2009
Reputation: 9
Posts: 278
Edit: Never mind I figured it out, was a lot simpler than I thought. Just making things harder than they are.

Last edited by BakonGuy: 09-22-2010 at 03:10 PM.
BakonGuy is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -7. The time now is 10:24 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2012, All Rights Reserved.