Panel.MoveToBack

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel:MoveToBack( )
Description:
Moves a panel so it renders below (behind) every other panel currently displaying.
Returns: nil
In Object: Panel
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Panel.MoveToBack]Panel.MoveToBack [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionMove a panel behind another panel, defined before it.
Used onNewerClient.png
Code
//First panel
local disp1 = vgui.Create("DFrame")
disp1:SetSize(400,500)
disp1:SetPos(200,400)
 
local button = vgui.Create("DButton",disp1)
button:SetText("Click me!")
button:Center()
 
//Second panel. By default, it will render in front of the the first panel.
local disp2 = vgui.Create("DFrame")
disp2:SetSize(300,700)
disp2:SetPos(250,300)
 
//Second panel will now be drawn behind the first.
disp2:MoveToBack()
Outputdisp1 is drawn above disp2, a panel that would normally obscure disp1.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox