Panel.MoveLeftOf

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel:MoveLeftOf( Panel Panel[, Integer Offset] )
Description:
This is a positioning utility for VGUI elements, allowing you to move an element to the left of another element.
Returns: nil
In Object: Panel
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Panel.MoveLeftOf]Panel.MoveLeftOf [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionMove a button to the left of another button.
Used onNewerClient.png
Code
local disp1 = vgui.Create("DFrame")
disp1:SetPos(0,200)
disp1:SetSize(400,500)
disp1:Center()
 
local button1 = vgui.Create("DButton",disp1)
button1:SetText("Click me!")
button1:Center()
 
local button2 = vgui.Create("DButton",disp1)
button2:SetText("Click me!")
button2:Center()
button2:MoveLeftOf(button1,20)
OutputButton2 is placed 20 pixels to the left of Button1.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox