Garry's Mod Wiki

Revision Difference

Panel:DockPadding#510546

<function name="DockPadding" parent="Panel" type="classfunc">⤶ <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.⤶ </description>⤶ <realm>Client</realm>⤶ <args>⤶ <arg name="paddingLeft" type="number">The left padding to the parent.</arg>⤶ <arg name="paddingTop" type="number">The top padding to the parent.</arg>⤶ <arg name="paddingRight" type="number">The right padding to the parent.</arg>⤶ <arg name="paddingBottom" type="number">The bottom padding to the parent.</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Example showing the effects of DockMargin and DockPadding</description>⤶ <code>⤶ 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)⤶ </code>⤶ <output></output>⤶ ⤶ </example>