Garry's Mod Wiki

Garry's Mod Wiki

  table derma.DefineControl( string name, string description, table tab, string base )


Defines a new Derma control with an optional base.

This calls vgui.Register internally, but also does the following:

  • Adds the control to derma.GetControlList
  • Adds a key "Derma" - This is returned by derma.GetControlList
  • Makes a global table with the name of the control (This is technically deprecated and should not be relied upon)
  • If reloading (i.e. called this function with name of an existing panel), updates all existing instances of panels with this name. (Updates functions, calls PANEL:PreAutoRefresh and PANEL:PostAutoRefresh, etc.)


1 string name
Name of the newly created control
2 string description
Description of the control
3 table tab
Table containing control methods and properties
4 string base
Derma control to base the new control off of


1 table
A table containing the new control's methods and properties


Defines a new control based off of DTextEntry that prints to the console whenever it is changed

local PANEL = {} function PANEL:OnChange() print(self:GetValue()) end derma.DefineControl("MyTextEntry", "Printing text entry control", PANEL, "DTextEntry")

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...