Garry's Mod Wiki

DPanel

Description

A simple rectangular box, commonly used for parenting other elements to. Pretty much all elements are based on this.

Parent

Derives from Panel.

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:

Methods

Page Links


Special Pages


Wikis

?

Render Time: 32ms

Session 0
DB GetPage 3
Generate Html 8
SaveChanges 13
Render Body 0
Render Sidebar 6