Widescreen Gaming Forum
http://www.wsgf.org/phpBB3/

Centered HUD for Team Fortress 2
http://www.wsgf.org/phpBB3/viewtopic.php?f=68&t=15556
Page 7 of 33

Author:  MaxDarklighter [ 25 Dec 2009, 23:17 ]
Post subject:  Re: Centered HUD for Team Fortress 2

I tried fixing it from a new copy of the file, but I cannot get #1 or #2 to work. Tried the old file as well and it still wouldn't work. The ammo worked for me with both files though, so I'm not sure what happened with your setup. Maybe someone else can look through and find out what needs to be changed.


Thx for reply and sorry for my mistakes. Allready fix it :cheers

Author:  Downtown1 [ 26 Dec 2009, 11:49 ]
Post subject:  Re: Centered HUD for Team Fortress 2

Yeah, I updated the HudLayout.res for the game too had pretty much the same problems as the poster above. Guess they moved some existing HUD elements into another one that was previously inert.

Author:  Delphium [ 29 Dec 2009, 14:14 ]
Post subject:  Re: Centered HUD for Team Fortress 2

Yeah, I updated the HudLayout.res for the game too had pretty much the same problems as the poster above. Guess they moved some existing HUD elements into another one that was previously inert.


Mind sharing your latest hudlayout.res if it is wokring with the latest updates of TF2 please?
I currently have mine working in tri screen only recently and would like to get the HUD centered for it, like i was able to with L4D2.

Many thanks.

Author:  CY:G [ 02 Jan 2010, 22:32 ]
Post subject:  Re: Centered HUD for Team Fortress 2

Same request here, cant find a hudlayout to work with the latest update...

Author:  Delphium [ 06 Jan 2010, 01:06 ]
Post subject:  Re: Centered HUD for Team Fortress 2

I'm getting there...



Just strugling with the weapon selection on the far right.

Here is my hudlayout.res file, it is for 5760x1080 (48:9 aspect ratio).
The value that I increased the xpos by was 853 for this ratio.

Also set the following as 0

This moves the progress bar to the center.
Code:
   HudObjectiveStatus
      {
         "fieldName" "HudObjectiveStatus"
         "visible" "1"
         "enabled" "1"
         "xpos"   "0"
         "ypos"   "0"
         "wide"   "f0"
         "tall"   "480"
      }


and

This moves the timer at the top center.
Code:
   HudKothTimeStatus
      {
         "fieldName" "HudKothTimeStatus"
         "visible" "1"
         "enabled" "1"
         "xpos"   "0"
         "ypos"   "0"
         "wide"   "f0"
         "tall"   "160"
      }


I have tried editing the hudweaponselection xpos but it appears not to yield any results so the selection of weapons appears to be stuck on the right far side.
Code:
   HudWeaponSelection
      {
         "fieldName" "HudWeaponSelection"
         "xpos"   "0"
         "wide"   "f0"
         "ypos"    "0"
         "tall"   "480"
         "RightMargin" "0"
         "RightMargin_hidef" "32"
         "RightMargin_lodef" "38"
         "visible" "1"
         "enabled" "1"
         "SmallBoxWide" "72"
         "SmallBoxTall" "54"
         "PlusStyleBoxWide" "90"
         "PlusStyleBoxTall" "63"
         "PlusStyleExpandSelected"   "0.3"
         "LargeBoxWide" "110"
         "LargeBoxTall" "77"
         "BoxGap" "4"   [$WIN32]
         "BoxGap" "4"   [$X360]
         "SelectionNumberXPos" "12"
         "SelectionNumberYPos" "4"
         "IconXPos" "8"
         "IconYPos" "0"
         "TextYPos" "70"      [$WIN32]
         "TextYPos" "65"      [$X360]
         "ErrorYPos" "48"
         "TextColor" "SelectionTextFg"
         "MaxSlots"   "6"
         "PlaySelectSounds"   "1"
         "Alpha" "220"
         "SelectionAlpha" "220"
         "BoxColor" "0 0 0 220"
         "SelectedBoxClor" "0 0 0 220"
         "SelectionNumberFg"   "200 187 161 255"
         "NumberFont" "HudSelectionText"
      }   

Author:  CY:G [ 06 Jan 2010, 15:36 ]
Post subject:  Re: Centered HUD for Team Fortress 2

Thank you :cheers , i will try it later today

Author:  Delphium [ 07 Jan 2010, 03:43 ]
Post subject:  Re: Centered HUD for Team Fortress 2

Getting closer still. :D





I was able to move weapon selection to the center screen by altering the "RightMargin" value to 853 under the "HuDWeaponSelection".

Code:
   HudWeaponSelection
      {
         "fieldName" "HudWeaponSelection"
         "xpos"   "r965"
         "wide"   "f0"
         "ypos"    "0"
         "tall"   "480"
         "RightMargin" "853"
         "RightMargin_hidef" "32"
         "RightMargin_lodef" "38"
         "visible" "1"
         "enabled" "1"
         "SmallBoxWide" "72"
         "SmallBoxTall" "54"
         "PlusStyleBoxWide" "90"
         "PlusStyleBoxTall" "63"
         "PlusStyleExpandSelected"   "0.3"
         "LargeBoxWide" "110"
         "LargeBoxTall" "77"
         "BoxGap" "4"   [$WIN32]
         "BoxGap" "4"   [$X360]
         "SelectionNumberXPos" "12"
         "SelectionNumberYPos" "4"
         "IconXPos" "8"
         "IconYPos" "0"
         "TextYPos" "70"      [$WIN32]
         "TextYPos" "65"      [$X360]
         "ErrorYPos" "48"
         "TextColor" "SelectionTextFg"
         "MaxSlots"   "6"
         "PlaySelectSounds"   "1"
         "Alpha" "220"
         "SelectionAlpha" "220"
         "BoxColor" "0 0 0 220"
         "SelectedBoxClor" "0 0 0 220"
         "SelectionNumberFg"   "200 187 161 255"
         "NumberFont" "HudSelectionText"
      }   


3x1920x1080 / 5760x1080 / (48:9) - working 07/Jan/2010
hudlayout.res


I have also worked with a friend to develop a perl script that reads the hudlayout.res file and is able to increment a defined value to all the xpos values, this had made updating and testing a lot faster than manually searching for and calculating each value by hand.

Code:

   #!/usr/bin/perl
   use strict;
   
   my $x = $ARGV[1];
   open(my $f, '<', $ARGV[0]);
   open(my $f2, '>', $ARGV[2]);
   my $text = '';
   $text .= $_ while(<$f>);
   $text =~ s/^(s*"xpos"s+"r?)(-?d+)(?=")/$1.($2+$x);/eim;
   my $hud_sections = join('|', [
     'HudWeaponSelection', 'HudKothTimeStatus',
     'HudObjectiveStatus', 'HudProgressBar']);
   $text =~ s/((?:$hud_sections)s+{[^}]*?
       "xpos"s+"r?)(-?d+)(?=")/$1.0/egisx;
   $text =~ s/(HudWeaponSelections+{[^}]*?
       "rightmargin"s+"r?)(-?d+)(?=")/$1.$x/eisx;
   print $fh2 $text;
   


Requires Perl

Run via command line by typing "perl hudlayout.pl hudlayout.res 853 hudlayout.fix.res"
I shall take a look at improving this script in the near future.

853 is the number used to increment each of the xpos values for 48:9 aspect ratio so change this value for other aspect ratios :).

Just remember to adjust the following values by hand afterwards.
HudWeaponSelection rightmargin = 853 (or what ever you increment the file by).
HudKothTimeStatus xpos = 0
HudObjectiveStatus xpos = 0
HudProgressBar xpos = 0
As such I have done the following other res packs, however none of these are tested but should in theory work ok.

hudlayout.res for 3x1680x1050 / 5040x1050 / (48:10)
hudlayout.res for 3x1280x1024 / 3840x1024 / (15:4)
hudlayout.res for 3x1024x768 / 3072x768 / (12:3)

hudlayout.res for 3x1920x1080 / 5760x1080 / (48:9) - working 07/Jan/2010

Note for a ratio of 48:9 the xpos values are incremented by 853.
480x16/9=853.
For a ratio of 48:10 I incremented the xpos values by 768.
480*16/10=768.
For a ratio of 15:4 I incremented the xpos values by 600.
480*5/4=600.
For a ratio of 12:3 I incremented the xpos values by 640.
480*4/3=640.

Author:  CY:G [ 07 Jan 2010, 15:34 ]
Post subject:  Re: Centered HUD for Team Fortress 2

That is awesome!!!, thanks for your work

Author:  A Small White Box [ 08 Jan 2010, 10:39 ]
Post subject:  Re: Centered HUD for Team Fortress 2

5040x1050 works, thanks for figuring it out,

Author:  CY:G [ 08 Jan 2010, 15:36 ]
Post subject:  Re: Centered HUD for Team Fortress 2

On my computer running at 5760 * 1200, your fix shows the bullet counter/Medic's Uber all the way in the lower right corner of the 3rd monitor.

Every other element is correctly centered tho, getting pretty close

Page 7 of 33 All times are UTC [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/