Panel.MoveAbove

From GMod Wiki

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



Examples

DescriptionMove a button above 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:MoveAbove(button1,20)
 
OutputButton2 is placed 20 pixels above Button1.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox