Skip to content

HUD examples

This site doesn’t keep its own HUD samples. These community projects already have working layouts. They are grouped by the kind of UI each one shows, and each link goes to the file to read first.

Some are server plugins (cs2-ui-kit, CustomHudProbeSW2, cs2kz-metamod, cs2-challenges) and the rest are map scripts. The layout files work the same either way; only the code that calls SetHasClass and SetDialogVariableString differs. Check a project’s license before copying from it. Projects with no license can be read but not reused.

Valve’s own example ships with the Workshop Tools: the cs_script_demo addon under content/csgo_addons/cs_script_demo/. Its welcome.xml, welcome.css and maps/scripts/setup.js show a dismissible dialog with a button and input capture. That is the smallest complete setup, and the one the overview describes.

  • cs2-map-mcp mechanics/hud.js (MIT): a small reusable wrapper around one custom_hud_layout, with show and hide per player, per-player text and a throttle so the script doesn’t resend every tick.
  • fyscs ze_diablo/hud.js (no license): a zombie-escape map’s HUD script that switches colour classes on a label.
  • point_worldtext: Source2Wiki’s walkthrough of Valve’s grenade training demo (MIT) updates world text with EntFireAtName({ name, input: "SetMessage", value }) and toggles it with Enable and Disable.
  • env_hudhint: fyscs ze_alien_shooter/bosshud.js (no license) shows a boss health readout through a hint entity.
  • radar_element and observable_element: no public community example yet. The script classes are CSRadarPoint (SetIcon, SetColor, SetVisibleToTeam) and CSObservablePoint; see the overview.

Know of a better example, or one for something missing here? A one-line addition to this page is welcome.