Category:DMenu

From Garry's Mod
Jump to: navigation, search

Contents

DescriptionPanelPage

A simple menu with sub menu, icon and convar support.

Inherited Functions

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


Examples

Example

Creates a DMenu with a submenu.

local Menu = DermaMenu()

-- Add a simple option.
Menu:AddOption( "Simple option" )

-- Simple option, but we're going to add an icon
local btnWithIcon = Menu:AddOption( "Option with icon" )
btnWithIcon:SetIcon( "icon16/bug.png" )	-- Icons are in materials/icon16 folder

-- Adds a simple line spacer
Menu:AddSpacer()

-- Add a submenu
local SubMenu = Menu:AddSubMenu( "A Sub Menu" )
SubMenu:AddOption( "Sub Option #1" ):SetIcon( "icon16/group.png" )

-- Open the menu
Menu:Open()


Personal tools
Navigation