Garry's Mod Wiki

DDrawer

Description

A simple Derma Drawer

Parent

Derives from Panel.

Methods

DDrawer:Close()
Closes the DDrawer.
number DDrawer:GetOpenSize()
Return the Open Size of DDrawer.
number DDrawer:GetOpenTime()
Return the Open Time of DDrawer.
DDrawer:Open()
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.
DDrawer:Toggle()
Toggles the DDrawer.

Example

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

Page Links


Special Pages


Wikis

?

Render Time: 86ms

DB GetPage 58
Generate Html 3
SaveChanges (1) 12
Render Body 0
Render Sidebar 11