Garry's Mod Wiki

DPanelOverlay

Description

Adds curved corners.

View source

Parent

Derives methods, etc not listed on this page from DPanel.

Methods

table DPanelOverlay:GetColor()
Returns the border color of the DPanelOverlay set by DPanelOverlay:SetColor.
number DPanelOverlay:GetType()
Returns the type of the DPanelOverlay set by DPanelOverlay:SetType.
DPanelOverlay:PaintDifferentColours( table cola, table colb, table colc, table cold, number size )
This is used internally - although you're able to use it you probably shouldn't. Used internally by the panel for type 3.
DPanelOverlay:PaintInnerCorners( number size )
This is used internally - although you're able to use it you probably shouldn't. Used internally by the panel for types 1 and 2.
DPanelOverlay:SetColor( table color )
Sets the border color of the DPanelOverlay.
DPanelOverlay:SetType( number type )
Sets the type of the DPanelOverlay.

Example

Creates a DPanel with a DPanelOverlay and adds a DLabel to it

local DFrame = vgui.Create( "DFrame" ) DFrame:SetSize( 350, 200 ) -- Set the size of the panel DFrame:Center() DFrame:MakePopup() local DPanel = vgui.Create( "Panel", DFrame ) DPanel:Dock( FILL ) local DLabel = vgui.Create( "DLabel", DPanel ) DLabel:SetPos( 10, 10 ) -- Set the position of the label DLabel:SetText( "I'm a DLabel inside a DPanel that has a DPanelOverlay border!" ) -- Set the text of the label DLabel:SizeToContents() -- Size the label to fit the text in it local DPanelOverlay = vgui.Create( "DPanelOverlay", DPanel ) DPanelOverlay:SetType( 1 ) -- Sets the type of overlay to add to the DPanel DPanelOverlay:SetColor( Color( 255, 0, 0 ) ) -- Sets the colour of the borders