Garry's Mod Wiki

Garry's Mod Wiki

  Panel:DockPadding( number paddingLeft, number paddingTop, number paddingRight, number paddingBottom )

Description

Sets the dock padding of the panel.

The dock padding is the extra space that will be left around the edge when child elements are docked inside this element.

Arguments

1 number paddingLeft
The left padding to the parent.
2 number paddingTop
The top padding to the parent.
3 number paddingRight
The right padding to the parent.
4 number paddingBottom
The bottom padding to the parent.

Example

Example showing the effects of DockMargin and DockPadding

local frame = vgui.Create("DFrame") frame:SetSize(600, 300) frame:SetTitle("Docking Demonstration") frame:Center() frame:MakePopup(true) local panel = vgui.Create("DPanel", frame) panel:DockMargin(10, 20, 30, 40) panel:DockPadding(40, 30, 20, 10) panel:Dock(FILL) local button = vgui.Create("DButton", panel) button:SetText("Lopsided proportions!") button:Dock(FILL)
Output:

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...