Manipulating the Goldsrc game menu items: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Added information about menu items sizing.)
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{stub}}
{{stub}}
=Constructing the menu items=
=Constructing the menu items=
The sizing and position of the menu items are directly influenced by the {{code|ProportionalBaseWidthHD}} or {{code|ProportionalBaseHeightHD}} parameters from {{path|resource/trackerscheme.res}}.
The sizing and position of the menu items are directly influenced by the {{code|ProportionalBaseWidthHD}} or {{code|ProportionalBaseHeightHD}} parameters from {{path|resource/trackerscheme.res}}, even if {{code|hd_background}} is set to 0 in {{path|[[liblist.gam]]}}.
 
== Item spacing ==
The spacing between items equals to {{code|MenuItemHeight}} * 1080 / {{code|ProportionalBaseHeightHD}}.
 
== Left padding ==
In-game left padding equals to {{code|GameMenuInset}} x window height / {{code|ProportionalBaseHeightHD}} when window height > {{code|ProportionalBaseHeightHD}}. When window height <= {{code|ProportionalBaseHeightHD}}, then the {{code|GameMenuInset}} parameter seems to be an absolute value, in pixels.
 
I found an edge case in resolution 720x480 where the padding was scaled down despite what's written above. The logic was tested and worked on resolutions 1920x1080, 1680x1050, 1600x900, 1280x720 and 1176x664.
 
== Bottom padding ==
Although apparently not set anywhere, bottom padding equals to 56 x 1080 / {{code|ProportionalBaseHeightHD}}
 
== Font size ==
Font size is not proportional to resolution, but only to {{code|ProportionalBaseHeightHD}}.
 
Height of smallcap letters is {{code|MenuLarge.Tall}} * 11 / 28 * 1080 / {{code|ProportionalBaseHeightHD}}.

Latest revision as of 13:34, 31 August 2025

Stub

This article or section is a stub. You can help by expanding it.

Constructing the menu items

The sizing and position of the menu items are directly influenced by the ProportionalBaseWidthHD or ProportionalBaseHeightHD parameters from 🖿resource/trackerscheme.res, even if hd_background is set to 0 in 🖿liblist.gam.

Item spacing

The spacing between items equals to MenuItemHeight * 1080 / ProportionalBaseHeightHD.

Left padding

In-game left padding equals to GameMenuInset x window height / ProportionalBaseHeightHD when window height > ProportionalBaseHeightHD. When window height <= ProportionalBaseHeightHD, then the GameMenuInset parameter seems to be an absolute value, in pixels.

I found an edge case in resolution 720x480 where the padding was scaled down despite what's written above. The logic was tested and worked on resolutions 1920x1080, 1680x1050, 1600x900, 1280x720 and 1176x664.

Bottom padding

Although apparently not set anywhere, bottom padding equals to 56 x 1080 / ProportionalBaseHeightHD

Font size

Font size is not proportional to resolution, but only to ProportionalBaseHeightHD.

Height of smallcap letters is MenuLarge.Tall * 11 / 28 * 1080 / ProportionalBaseHeightHD.