Panel.GetSkin

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel:GetSkin( )
Description:
Gets the skin of the panel.
Returns: String
In Object: Panel
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Panel.GetSkin]Panel.GetSkin [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCreates a basic DFrame and sets the skin.
Used onNewerClient.png
Code
local HeadFrame = vgui.Create( "DFrame" )
HeadFrame:SetSize( 200, 200 )
HeadFrame:Center( )
HeadFrame:SetTitle( "A Random Title")
HeadFrame:SetSkin("AnExampleSkin") --We have chosen this random skin.
HeadFrame:MakePopup( )
 
local HeadButton = vgui.Create( "DButton", HeadFrame ) --The frame is the button's parent
HeadButton:SetPos(20,20)
HeadButton:SetSize(120,40)
HeadButton:SetTitle("What Skin Is HeadFrame Using")
HeadButton.OnClick = function()
	Msg(HeadFrame:GetSkin()) --It now prints the HeadFrame's skin(in this case: AnExampleSkin) into your console.
end
OutputCreates a DFrame and a DButton. When you press the button, it will tell the DFrame's skin.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox