DPropertySheet.SetDrawBackground
From GMod Wiki
Function | |
Syntax | DPropertySheet:SetDrawBackground( Bool draw ) |
Description: | |
Sets if the background should be drawn or not, true draws, false doesn't | |
Returns: | Nil |
In Object: | DPropertySheet |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=DPropertySheet.SetDrawBackground]DPropertySheet.SetDrawBackground [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Creates a DPropertySheet and checks if the background is opaque or transparent |
---|---|
Used on | |
Code | local DermaPanel = vgui.Create( "DFrame" ) DermaPanel:SetPos( 50, 50 ) DermaPanel:SetSize( 350, 400 ) DermaPanel:SetTitle( "Testing Derma Stuff" ) DermaPanel:SetVisible( true ) DermaPanel:SetDraggable( false ) DermaPanel:ShowCloseButton( true ) DermaPanel:MakePopup() DermaPanel:SetDrawBackground( false ) //The background of the panel will now be transparent, this does NOT include the tabs, which wil draw as normal. local PropertySheet = vgui.Create( "DPropertySheet", DermaPanel ) PropertySheet:SetPos( 5, 30 ) PropertySheet:SetSize( 340, 315 ) local SheetItemOne = vgui.Create( "DCheckBoxLabel" ) SheetItemOne:SetText( "Use Props?" ) SheetItemOne:SetConVar( "some_convar" ) SheetItemOne:SetValue( 1 ) SheetItemOne:SizeToContents() local sheet1 = PropertySheet:AddSheet( "Tab 1", SheetItemOne, "gui/silkicons/user", false, false, "Tooltip 1" ) end |
Output | Creates a DFrame with a transparent DPropertySheet inside it. |
Additional Notes
- This function is not required when you're overriding the Paint hook.