DermaMenu

From Garry's Mod
Jump to: navigation, search
 DermaMenu( )

Contents

Description

Creates a DMenu similar to a contextmenu and closes any current menus

Arguments

Panel parent

The panel to parent the created menu to.

Returns

Panel

The created DMenu

Examples

Example

Creates a DMenu with buttons to commit suicide or close it.

local menu = DermaMenu() 
menu:AddOption("Die", function() RunConsoleCommand("kill") end)
menu:AddOption("Close", function() print("Close pressed") end) -- The menu will remove itself, we don't have to do anything.
menu:Open()

Output:

DermaMenu.png
Personal tools
Navigation