VGUI - tmp64/BugfixedHL GitHub Wiki

VGUI library provides interfaces to draw objects and text on the screen. Valve have developed two big versions of VGUI: VGUI (VGUI1) and VGUI2.

Both VGUIs also come with a controls library that contains buttons, lables, text fields, windows, etc.

VGUI1

It was originally made for Team Fortress Classic and was ported to Half-Life and other GoldSrc games. It is used in those games for scoreboard, MOTD dialog and graphical menus (e.g. team and class selection dialog in TFC).

Limitations

  • Complete lack of public documentation except comments in C++ header files.
  • Uses single byte characters, no support for Unicode.
  • Can only draw bitmap fonts in TGA format.
  • No source code is available.

VGUI2

Was developed for Source and Steam and ported to GoldSrc for its Steam release in 2003.

It is used in the game for GameUI, a library that contains console dialog and main game menu dialogs (New/Save/Load Game, Settings, UI for CS: Condition Zero), and in CS1.6 and CS:CZ for scoreboard, MOTD and graphical menus (that is, replaces VGUI1).

It overcomes all VGUI1 limitations stated above:

  • Documentation can be found on Valve Developer Community.
  • Uses 2 byte "wide" characters that support Basic Multilingual Plane of Unicode (contains characters for almost all modern languages).
  • Supports system TrueType fonts.
  • Implementation of interfaces is hidden in the engine, but vgui_controls library is open source.