Nuclide
Software Development Kit for id Technology (BETA)
|
Truly versatile user interface, for menus and in-game surfaces. More...
Truly versatile user interface, for menus and in-game surfaces.
Nuclide ships with this component as the default interface library.
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.
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:
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.
This file will give you a grey menu, with white text that's slightly transparent and has no icons, but rounded corners:
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.
Classes | |
class | vguiWidget |
The base VGUI widget class. More... | |
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) |
void | vguiWidget::vguiWidget (void) |
nonvirtual void | vguiWidget::SetTheme (vguiTheme) |
Sets the vguiTheme to use on this widget (and any children it may have) More... | |
nonvirtual vguiTheme | vguiWidget::GetTheme (void) |
Returns the VGUI that will be used on this widget. More... | |
nonvirtual bool | vguiWidget::Visible (void) |
Returns true/false depending on if the widget is visible. More... | |
nonvirtual void | vguiWidget::Hide (void) |
Hide the widget. More... | |
virtual void | vguiWidget::NowHidden (void) |
virtual void | vguiWidget::NowVisible (void) |
nonvirtual void | vguiWidget::Show (void) |
Show the widget. More... | |
virtual void | vguiWidget::PositionChanged (vector, vector) |
Called when the position of the widget was changed in any capacity. More... | |
virtual void | vguiWidget::SizeChanged (vector, vector) |
Called when the size of the widget has changed in any capacity. More... | |
nonvirtual void | vguiWidget::SetPos (vector) |
Set the position within its context. More... | |
nonvirtual vector | vguiWidget::GetPos (void) |
Return the position of the widget within its context. More... | |
nonvirtual int | vguiWidget::GetPosWidth (void) |
Returns the X coordinate of the widget position within its context. More... | |
nonvirtual int | vguiWidget::GetPosHeight (void) |
Returns the Y coordinate of the widget position within its context. More... | |
nonvirtual void | vguiWidget::SetSize (vector) |
Set the size of the widget to a new one. More... | |
nonvirtual vector | vguiWidget::GetSize (void) |
Returns the size of the widget, in pixels. More... | |
nonvirtual int | vguiWidget::GetWidth (void) |
Returns the width of the widget, in pixels. More... | |
nonvirtual int | vguiWidget::GetHeight (void) |
Returns the height of the widget, in pixels. More... | |
nonvirtual void | vguiWidget::SetMinSize (vector) |
Sets the minimum size of the widget. More... | |
nonvirtual vector | vguiWidget::GetMinSize (void) |
Returns the minimum size of the widget. More... | |
nonvirtual void | vguiWidget::SetMaxSize (vector) |
Sets the maximum size of the widget. More... | |
nonvirtual vector | vguiWidget::GetMaxSize (void) |
Returns the maximum size of the widget. More... | |
nonvirtual void | vguiWidget::FlagAdd (int) |
Add a flag to the widget. More... | |
nonvirtual void | vguiWidget::FlagRemove (int) |
Remove a flag from the widget. More... | |
nonvirtual bool | vguiWidget::HasFlag (int) |
Check if the vguiWidget has a flag attached. More... | |
virtual void | vguiWidget::Reposition (void) |
Called whenever the physical properties of the display change. More... | |
virtual void | vguiWidget::Add (vguiWidget) |
Adds a widget into this one. More... | |
virtual void | vguiWidget::Draw (void) |
Called in order to draw the widget. More... | |
virtual bool | vguiWidget::Input (float, float, float, float) |
Called whenever an input event gets directed to the widget. More... | |
virtual void | vguiWidget::Spawned (void) |
Called when the widget has fully initialized. More... | |
|
virtual |
Adds a widget into this one.
Reimplemented in vguiView.
|
virtual |
Called in order to draw the widget.
Reimplemented in vgui3DView, vguiButton, vguiCheckbox, vguiCommandButton, vguiFrame, vguiLabel, vguiList, vguiListBox, vguiMenuButton, vguiMenuTitle, vguiPic, vguiProgressBar, vguiRadio, vguiRect, vguiSlider, vguiTabView, vguiTabViewItem, vguiTextBox, vguiTextView, vguiView, and vguiWindow.
void vguiWidget::FlagAdd | ( | int | iFlag | ) |
Add a flag to the widget.
void vguiWidget::FlagRemove | ( | int | iFlag | ) |
Remove a flag from the widget.
int vguiWidget::GetHeight | ( | void | ) |
Returns the height of the widget, in pixels.
vector vguiWidget::GetMaxSize | ( | void | ) |
Returns the maximum size of the widget.
vector vguiWidget::GetMinSize | ( | void | ) |
Returns the minimum size of the widget.
vector vguiWidget::GetPos | ( | void | ) |
Return the position of the widget within its context.
int vguiWidget::GetPosHeight | ( | void | ) |
Returns the Y coordinate of the widget position within its context.
int vguiWidget::GetPosWidth | ( | void | ) |
Returns the X coordinate of the widget position within its context.
vector vguiWidget::GetSize | ( | void | ) |
Returns the size of the widget, in pixels.
vguiTheme vguiWidget::GetTheme | ( | void | ) |
Returns the VGUI that will be used on this widget.
int vguiWidget::GetWidth | ( | void | ) |
Returns the width of the widget, in pixels.
bool vguiWidget::HasFlag | ( | int | flag | ) |
Check if the vguiWidget has a flag attached.
void vguiWidget::Hide | ( | void | ) |
Hide the widget.
|
virtual |
Called whenever an input event gets directed to the widget.
Reimplemented in vgui3DView, vguiButton, vguiCheckbox, vguiCommandButton, vguiLabel, vguiList, vguiListBox, vguiMenuButton, vguiMenuTitle, vguiPic, vguiRadio, vguiRect, vguiSlider, vguiTabView, vguiTabViewItem, vguiTextBox, vguiTextView, vguiView, and vguiWindow.
|
virtual |
|
virtual |
Reimplemented in vguiWindow.
|
virtual |
Called when the position of the widget was changed in any capacity.
Reimplemented in vguiTabView.
|
virtual |
Called whenever the physical properties of the display change.
Reimplemented in vguiMenuButton, and vguiMenuTitle.
void vguiWidget::SetMaxSize | ( | vector | vecNewSize | ) |
Sets the maximum size of the widget.
void vguiWidget::SetMinSize | ( | vector | vecNewSize | ) |
Sets the minimum size of the widget.
void vguiWidget::SetPos | ( | vector | vecNewPos | ) |
Set the position within its context.
void vguiWidget::SetSize | ( | vector | vecNewSize | ) |
Set the size of the widget to a new one.
void vguiWidget::SetTheme | ( | vguiTheme | theme | ) |
Sets the vguiTheme to use on this widget (and any children it may have)
void vguiWidget::Show | ( | void | ) |
Show the widget.
|
virtual |
Called when the size of the widget has changed in any capacity.
Reimplemented in vguiTabView, and vguiWindow.
|
virtual |
Called when the widget has fully initialized.
When you override this, you may call super::Spawned();
to ensure the parent classes get to finish initializing also.
Reimplemented in TestUI, vgui3DView, vguiButton, vguiCheckbox, vguiLabel, vguiList, vguiListBox, vguiMenuButton, vguiPic, vguiRadio, vguiRect, vguiSlider, vguiTabView, vguiTabViewItem, vguiTextBox, vguiTextView, and vguiWindow.
vguiWidget UIClass_Spawn | ( | string | cname | ) |
void UISystem_Init | ( | void | ) |
bool Util_MouseAbove | ( | vector | vecMousePos, |
vector | vecPos, | ||
vector | vecSize | ||
) |
Returns whether our mouse cursor is in a specific region of the screen.
bool VGUI_Active | ( | void | ) |
Return whether a VGUI panel is active on the 2D overlay level.
void vguiWidget::vguiWidget | ( | void | ) |
bool vguiWidget::Visible | ( | void | ) |
Returns true/false depending on if the widget is visible.