User Tag List

Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: sgHUD: RU Color

  1. #11
    Dominating Disturbed//*.'s Avatar
    Join Date
    Jan 2011
    Posts
    608
    Country:
    Quote Originally Posted by Crsk View Post
    with a background the HUD size no need to be so bigger

    I like the "RU BAR" The gold'ish. Its like a bar that tells you if your RU is full.

  2. #12
    Rampage Crsk's Avatar
    Join Date
    Nov 2011
    Location
    I'm out
    Posts
    323
    Country:
    image 5: yellow text + ru bar + new core icons + "BASECORE:" removed


    no photoshop this time, it's already done, here's the code.

    Code:
    class sgHUD extends ChallengeTeamHUD config;
    
    // I imported it here just to try, should go in 'sgUMedia.Icons'
    #exec TEXTURE IMPORT NAME=IconCore FILE=Textures\IconCore.bmp GROUP=Icons
    
    // used by the RU bar
    var() color YellowColor, DarkColor;
    
    // Used by the team core icons
    var() color TeamColors[4];
    
    // the code under this function is new, it can be added as an extension
    simulated function DrawGameSynopsis(canvas Canvas)
    {
    	local float XR,YR;
    
    	// saving text length of player's RU to then use to adjust the RU bar length
    	Canvas.TextSize(int(PRI.RU)@"/"@int(sgPRI(PawnOwner.PlayerReplicationInfo).MaxRU), XR, YR);
    	
    	// setting the possition in where to draw (XL and YOffset are old DrawGameSynopsis() variables)
    	Canvas.SetPos(XL+7, YOffset+25);
    	
    	// setting a dark color to give some contrast to the next drawn texture
    	Canvas.DrawColor = DarkColor;
    	
    	// drawing a dark bar
    	Canvas.DrawTile(Texture'BotPack.FacePanel2', XR, 2.0, 0, 0, 128.0, 64.0);
    	
    	// setting same position as before so the yellow bar will be above the dark bar, using dark bar as container
    	Canvas.SetPos(XL+7, YOffset+25);
    	
    	// establishing a color before draw to improve the yellow bar appearance
    	Canvas.DrawColor = YellowColor;
    	
    	// the function in where we are is called from PostRender function and this is called from Tick function so here is a good place to make RU bar lenght proportional to the drawn RU ammount
    	Canvas.DrawTile(Texture'BotPack.HudElements1', FMin(XR*int(PRI.RU)/int(sgPRI(PawnOwner.PlayerReplicationInfo).MaxRU),XR), 2.0, 64, 64, 128.0, 8.0);
    }
    
    // the code under this function has been modified, it can be entirely replaced
    simulated function DrawTeam(Canvas Canvas, TeamInfo TI)
    {
    	local int i;
    	
    	if ( (TI != None) && (TI.Size > 0) )
    	{
    		// iterator to pick the correct color before draw the core icon and its health
    		for (i=0; i<=4; i++)
    		{
    			if (TI.TeamIndex == i)
    			{
    				Canvas.DrawColor = TeamColors[i];
    				Canvas.Font = MyFonts.GetMediumFont( Canvas.ClipX );
    				Canvas.SetPos(Canvas.ClipX - 72, Canvas.ClipY - (384 + 72 * i));
    				Canvas.DrawIcon(Texture'IconCore', 1.0);
    				Canvas.SetPos(Canvas.ClipX - 112, Canvas.ClipY - (368 + 72 * i));
    				Canvas.DrawText(int(TI.Score), false);
    				break;
    			}
    		}
    	}
    }
    
    defaultproperties
    {
    	YellowColor=(R=255,G=162,B=0,A=0)
    	DarkColor=(R=24,G=24,B=24,A=0)
    	TeamColors(0)=(R=64,G=0,B=0,A=0)
    	TeamColors(1)=(R=0,G=0,B=64,A=0)
    	TeamColors(2)=(R=0,G=64,B=23,A=0)
    	TeamColors(3)=(R=142,G=109,B=0,A=0)
    }
    w5ykj

  3. #13
    Whicked Sick Higor's Avatar
    Join Date
    Apr 2012
    Location
    Full sail ahead!
    Posts
    3,676
    Country:
    That might be a bit theme altering... but I REALLY like this kind of hud (sort of Source and UT3 mix...)
    Wouldn't be a bad idea to do a whole different HUD system and let the player choose it in the Constructor GUI.

    PD: Modulated backgrounds with rounded edges look pretty and take 9 drawcalls from a very small texture (expensive on Software renderers tho).
    PD2: And texts as seen below (modulated, bright shaded, antialiased) are easy to do, got some nice methods you'll may want to learn.
    ------------------------------------- * -------------------------------------

  4. #14
    Rampage Crsk's Avatar
    Join Date
    Nov 2011
    Location
    I'm out
    Posts
    323
    Country:
    Quote Originally Posted by Higor View Post
    got some nice methods you'll may want to learn.
    yes, i love learning
    w5ykj

  5. #15
    Whicked Sick Higor's Avatar
    Join Date
    Apr 2012
    Location
    Full sail ahead!
    Posts
    3,676
    Country:
    I'll write up a guide in UT99.org one of these days, soon I hope.
    ------------------------------------- * -------------------------------------

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Code review: sgHUD
    By Higor in forum Code Reviews
    Replies: 6
    Last Post: 06-01-2012, 03:45 PM
  2. Code review: sgHUD
    By Higor in forum #siegepug Discussion
    Replies: 6
    Last Post: 06-01-2012, 03:45 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •