Manipulating the Goldsrc game menu items: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 12: Line 12:


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.
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.
== Font size ==
Font size is not proportional to resolution, but only to {{code|ProportionalBaseHeightHD}}.

Revision as of 08:13, 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 resolution.Y * MenuItemHeight / ProportionalBaseHeightHD.

The items are aligned to the bottom of the window, with an inset calculated based on MenuItemHeight, but how?

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.

Font size

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