DPanel
Description
A simple rectangular box, commonly used for parenting other elements to. Pretty much all elements are based on this.
Parent
Derives methods, etc not listed on this page from Panel.
Methods
table DPanel:GetBackgroundColor()
Returns the panel's background color.
By default this returns nil even though the default background color is white
boolean DPanel:GetDrawBackground()
We advise against using this. It may be changed or removed in a future update.
You should use DPanel:GetPaintBackground instead.
Returns whether or not the panel background is being drawn. Alias of DPanel:GetPaintBackground.
DPanel:SetDrawBackground( boolean draw )
We advise against using this. It may be changed or removed in a future update.
You should use DPanel:SetPaintBackground instead.
Sets whether or not to draw the panel background. Alias of DPanel:SetPaintBackground.
Example
Creates a DPanel and adds a DLabel to it
local DPanel = vgui.Create( "DPanel" )
DPanel:SetPos( 10, 30 ) -- Set the position of the panel
DPanel:SetSize( 200, 200 ) -- Set the size of the panel
local DLabel = vgui.Create( "DLabel", DPanel )
DLabel:SetPos( 10, 10 ) -- Set the position of the label
DLabel:SetText( "I'm a DLabel inside a DPanel! :)" ) -- Set the text of the label
DLabel:SizeToContents() -- Size the label to fit the text in it
DLabel:SetDark( 1 ) -- Set the colour of the text inside the label to a darker one
Output: 
