Nuclide
Software Development Kit for id Technology (BETA)
Vera GUI

Truly versatile user interface, for menus and in-game surfaces. More...

Detailed Description

Truly versatile user interface, for menus and in-game surfaces.

Nuclide ships with this component as the default interface library.

Menu using Vera GUI

Its design goals were to be easily customizable through some common parameters, and a per-object based theme engine for anything more advanced. It also needed to be usable on in-game surfaces.

Interactive surfaces

Customization

You can make trivial changes using external UI styling files, this is not following any specific spec and may be subject to change some day to adopt something more standardized.

Currently however you can modify the file (create them if they don't exist) named scripts/ui_style.txt. Said file will contain a variety of key/value pairs:

Note
Color and alpha values target channels with values between 0 and 255.

If a file named scripts/client_style.txt exists, it will be read instead by the client-game - but not by the main menu. That way you can have different colorschemes for both modules at the same time.

Example Style File

This file will give you a grey menu, with white text that's slightly transparent and has no icons, but rounded corners:

COLOR=200 200 200
FG_COLOR=255 255 255
ALPHA=196
NOICONS=1
ROUNDED=1

Advanced Themes

Theming an object through more advanced means is possible with vguiTheme. vguiTheme is responsible for theming everything, but it is also designed to co-exist with other theme engines.

Use vguiWidget::SetTheme() to override the theme engine any of your widgets are using with an instance of your own. For that, make a child-class of vguiTheme and override the methods you want changed within it. Then use the aforementioned method to override it on a per-object basis.

While you can theme individual elements, all of their child-widgets (e.g. the close button on a window) will inherit the theme of their parent by default.

Note
For most use-cases, you will want to call vguiWidget::SetTheme() on the very first vguiWidget, the one everything else will be added to using vguiWidget::Add()

Classes

class  vgui3DView
 VGUI Widget: 3D View. More...
 
class  vguiButton
 VGUI Widget: Button. More...
 
class  vguiCheckbox
 VGUI Widget: Checkbox. More...
 
class  vguiColor
 Container class that'll deal with handling colors via a variety of different means. More...
 
class  vguiCommandButton
 VGUI Widget: Command Menu Button. More...
 
class  vguiControl
 VGUI: Abstract Control Class. More...
 
class  vguiFrame
 VGUI Widget: Frame. More...
 
class  vguiLabel
 VGUI Widget: Label. More...
 
class  vguiList
 VGUI Widget: List. More...
 
class  vguiListBox
 VGUI Widget: List Box. More...
 
class  vguiMenuButton
 VGUI Widget: Menu Button. More...
 
class  vguiMenuTitle
 VGUI Widget: Menu Title. More...
 
class  vguiPic
 VGUI Widget: Picture Frame. More...
 
class  vguiProgressBar
 VGUI Widget: Frame. More...
 
class  vguiRadio
 VGUI Widget: Radio Button. More...
 
class  vguiRect
 VGUI Widget: Picture Frame. More...
 
class  vguiSlider
 VGUI Widget: Slider. More...
 
class  vguiTabView
 VGUI Widget: Tab View. More...
 
class  vguiTabViewItem
 VGUI Widget: Button. More...
 
class  vguiTextBox
 VGUI Widget: Text Box. More...
 
class  vguiTextView
 VGUI Widget: Text View. More...
 
class  vguiView
 VGUI Widget: Sub-view. More...
 
class  vguiWindow
 VGUI: Window. More...
 

Functions

bool VGUI_Active (void)
 Return whether a VGUI panel is active on the 2D overlay level. More...
 
bool Util_MouseAbove (vector vecMousePos, vector vecPos, vector vecSize)
 Returns whether our mouse cursor is in a specific region of the screen. More...
 
void UISystem_Init (void)
 
vguiWidget UIClass_Spawn (string cname)
 

Function Documentation

◆ UIClass_Spawn()

vguiWidget UIClass_Spawn ( string  cname)

◆ UISystem_Init()

void UISystem_Init ( void  )

◆ Util_MouseAbove()

bool Util_MouseAbove ( vector  vecMousePos,
vector  vecPos,
vector  vecSize 
)

Returns whether our mouse cursor is in a specific region of the screen.

◆ VGUI_Active()

bool VGUI_Active ( void  )

Return whether a VGUI panel is active on the 2D overlay level.