Garry's Mod Wiki

Label

  Panel Label( string text, Panel parent = nil )

Description

Convenience function that creates a DLabel, sets the text, and returns it

Arguments

1 string text
The string to set the label's text to
2 Panel parent = nil
Optional. The panel to parent the DLabel to

Returns

1 Panel
The created DLabel

Example

Create a label

local lbl = Label( "The quick brown fox" )

Example

Create a label and parents it to a DPanel

local pnl = vgui.Create("DPanel") local lbl = Label( "The quick brown fox", pnl )