Category:DIconBrowser

From Garry's Mod
Jump to: navigation, search

Contents

DescriptionPanelPage

Simply a DIconLayout which automatically displays all of the Silkicons. Used as a way to get the user to select an icon.

Inherited Functions

Inherits the following functions from DScrollPanel and its parents up to 3 levels deep:


Examples

Example

Creates a DIconBrowser which, when an icon is clicked, prints said icon's directory.

local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 100, 100 )
DermaPanel:SetSize( 300, 200 )
DermaPanel:SetTitle( "DIconBrowserExample" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()

local IconBrowser = vgui.Create( "DIconBrowser", DermaPanel )
IconBrowser:SetPos( 5, 30 )
IconBrowser:SetSize( 290, 265 )
IconBrowser.OnChange = function(self)
    chat.AddText( "You selected: " .. self:GetSelectedIcon())
end


Personal tools
Navigation