Panel.SetPos

From GMod Wiki

Revision as of 14:39, 19 September 2010 by Averice (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Panel.SetPos]Panel.SetPos [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSets the position of the panel on the screen.
Used onMost 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
.
OutputPositions the panel in pixels.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox