P.Label

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel:Label( String )
Description:
A basic label or "single line text area" that is non-editable.
Returns: nil
In Object: Panel
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=P.Label]P.Label [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Usage

Easy label for use on any frame.

DescriptionCreates a label and fills it with the text "Lua is alive!" parented to a simple frame.
Used onNewerClient.png
Code
 
local frame = vgui.Create("Frame")
 
frame.Label1 = vgui.Create("Label", frame)
frame.Label1:SetPos(50,50)
frame.Label1:SetText("Lua is alive!")
frame.Label1:SizeToContents()
 
frame:SetSize( ScrW()*0.25, ScrH()*0.25 )
frame:Center()
frame:SetVisible( true )
frame:MakePopup()
 
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox