Garry's Mod Wiki

Garry's Mod Wiki


A simple Derma Drawer

View source


Derives methods, etc not listed on this page from Panel.


Closes the DDrawer.
Return the Open Size of DDrawer.
Return the Open Time of DDrawer.
Opens the DDrawer.
DDrawer:SetOpenSize( number Value )
Set the height of DDrawer
DDrawer:SetOpenTime( number value )
Set the time (in seconds) for DDrawer to open.
Toggles the DDrawer.


Creates a DDrawer in a DFrame; set the open size and time; add a panel in the drawer; open the DDrawer.

local Frame = vgui.Create( "DFrame" ) Frame:SetSize( 400, 200 ) Frame:Center() Frame:MakePopup() local Drawer = vgui.Create( "DDrawer", Frame ) Drawer:SetOpenSize( 75 ) -- Default OpenSize is 100 Drawer:SetOpenTime( 0.2 ) -- Default OpenTime is 0.3 Drawer:Open() -- You can also use Drawer:Close() and Drawer:Toggle() //Let's add a panel, because Drawer is empty local PanelInDrawer = vgui.Create( "DPanel", Drawer ) PanelInDrawer:Dock( FILL ) -- Make PanelInDrawer fill place of Drawer PanelInDrawer:DockMargin( 3, 0, 3, 3 ) -- Margins for the dock. Search on wiki for more info

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...