Panel.SetPos
From GMod Wiki
Function | |
Syntax | Panel:SetPos( Number x, Number y ) |
Description: | |
Sets the position of the panel relative to the parent. | |
Returns: | nil |
In Object: | Panel |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Panel.SetPos]Panel.SetPos [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Sets the position of the panel on the screen. |
---|---|
Used on | Most Panels |
Code | local myPanel = vgui.Create("DPanel") myPanel:SetSize(100,100) myPanel:SetPos(10, 10) -- or myPanel:SetPos(ScrW()/2-50, ScrH()/2-50) -- Center. |
Output | Positions the panel in pixels. |