Panel.MoveToFront

From GMod Wiki

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



Examples

DescriptionMove a panel in front of another panel, defined after 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)
 
//First panel will now be drawn in front of the second.
disp1:MoveToFront()
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