Category:DPanel

From Garry's Mod
Jump to: navigation, search

Contents

DescriptionPanelPage

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

Inherited Functions

Inherits the following functions from Panel and its parents up to 3 levels deep:


Examples

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:


DPanel large.png

Methods

Personal tools
Navigation