Garry's Mod Wiki

vgui.Create

  Panel vgui.Create( string classname, Panel parent = nil, string name = nil )

Description

Creates a panel by the specified classname.

Custom VGUI elements are not loaded instantly. Use GM:OnGamemodeLoaded to create them on startup.

Arguments

1 string classname
Classname of the panel to create.

Default panel classnames can be found on the VGUI Element List.

New panels can be registered via vgui.Register

2 Panel parent = nil
Panel to parent to.
3 string name = nil
Custom name of the created panel for scripting/debugging purposes. Can be retrieved with Panel:GetName.

Returns

1 Panel
The created panel, or nil if creation failed for whatever reason.