Changing the fading speed of the GUI Windows

From Valve Developer Community
Jump to navigation Jump to search

The speed at which the GUI, or Graphical User Interface, fades in and out as well as the fading speed when switching between tabs in the HL2 GUI can easily be changed by editing SteamApps\YourMod\Resource\SourceScheme.res with Notepad or another text editor.

If you have not created the mod project and you want to edit the original Source engine game, the SourceScheme.res will have to be extracted from the SteamApps\common\SourceSDK\vpks\depot_211_dir.vpk cache file. GCFScape can be used to extract files from a GCF and/or VPK. The file needed in this tutorial can be found here: root\hl2\resource\SourceScheme.res. It will have to be extracted into the SteamApps\common\half-life 2\hl2\resource folder. For a custom mod, the file will have to be extracted to SteamApps\YourMod\Resource\SourceScheme.res.

Open the SteamApps\YourMod\Resource\SourceScheme.res file.

On Line 63:

		Frame.TitleTextInsetX			16
		Frame.ClientInsetX			8
		Frame.ClientInsetY			6
		Frame.BgColor				"160 160 160 128"
		Frame.OutOfFocusBgColor			"160 160 160 32"
		Frame.FocusTransitionEffectTime		"0.3"	// time it takes for a window to fade in/out on focus/out of focus
		Frame.TransitionEffectTime		"0.08"	// time it takes for a window to fade in/out on open/close
		Frame.AutoSnapRange			"0"

The speed at which a window fades in and out can be changed by editing the value Frame.FocusTransitionEffectTime. A good value to set it to would be 0.08.

The fading speed when switching between tabs is located at Line 117:

		PropertySheet.TextColor			"OffWhite"
		PropertySheet.SelectedTextColor		"White"
		PropertySheet.TransitionEffectTime	"0.08"	// time to change from one tab to another

The value PropertySheet.TransitionEffectTime can be changed to 0.08.

Save your changes in order to see this effect.