Panel.SetContentAlignment

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel:SetContentAlignment( direction )
Description:
Sets the base vgui components of the panel to align to a specific corner
Returns: nil
In Object: Panel
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Panel.SetContentAlignment]Panel.SetContentAlignment [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSets a label's text to centre
Used onNewerClient.png
Code
 
    local label = vgui.Create( "Label" )
    label:SetText( "Testing text" )
    label:SetContentAlignment( 5 )
 
OutputN/A


Additional Notes

The direction is based of the number pad, 5 is middle, 7 is top left, 6 is right middle etc.

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox