Panel.SetContentAlignment
From GMod Wiki
| 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: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Panel.SetContentAlignment]Panel.SetContentAlignment [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | Sets a label's text to centre |
|---|---|
| Used on | |
| Code |
local label = vgui.Create( "Label" )
label:SetText( "Testing text" )
label:SetContentAlignment( 5 )
|
| Output | N/A |
Additional Notes
The direction is based of the number pad, 5 is middle, 7 is top left, 6 is right middle etc.