Garry's Mod Wiki

Revision Difference

DFrame#515981

<panel> <parent>EditablePanel</parent> <description>The DFrame control is the foundation for any Derma menu. It holds all of your controls.</description> <hooks></hooks>⤶ <file>lua/vgui/dframe.lua</file>⤶ <hooks>|File=lua/vgui/dframe.lua</hooks>⤶ </panel> <example> <description>Creates a DFrame.</description> <code> local DermaPanel = vgui.Create( "DFrame" ) DermaPanel:SetPos( 100, 100 ) DermaPanel:SetSize( 300, 200 ) DermaPanel:SetTitle( "My new Derma frame" ) DermaPanel:SetDraggable( true ) DermaPanel:MakePopup() </code> </example> <example> <description>Creates a DFrame with only close button.</description> <code> local DermaPanel = vgui.Create( "DFrame" ) DermaPanel:SetPos( 100, 100 ) DermaPanel:SetSize( 300, 200 ) DermaPanel:SetTitle( "My new Derma frame" ) DermaPanel:SetDraggable( true ) DermaPanel:MakePopup() DermaPanel.btnMinim:SetVisible(false) DermaPanel.btnMaxim:SetVisible(false) </code> </example> <example> <description>Creates a DFrame with custom title color.</description> <code> local DermaPanel = vgui.Create( "DFrame" ) DermaPanel:SetPos( 100, 100 ) DermaPanel:SetSize( 300, 200 ) DermaPanel:SetTitle( "My new Derma frame" ) DermaPanel:SetDraggable( true ) DermaPanel:MakePopup() DermaPanel.lblTitle.UpdateColours = function( label ) label:SetTextStyleColor( color_green ) end </code> </example>