Derma_StringRequest

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

Contents

Description

Creates a derma window asking players to input a string.

Arguments

string title

The title of the created panel.

Arguments

string subtitle

The text above the input box

Arguments

string default

The default text for the input box.

Arguments

function confirm

The function to be called once the user has confirmed their input.

Arguments

function cancel=nil

The function to be called once the user has cancelled their input

Arguments

string confirmText="OK"

Allows you to override text of the "OK" button

Arguments

string cancelText="Cancel"

Allows you to override text of the "Cancel" button

Returns

Panel

The created DFrame

Examples

Example

Asks the user to input a string which is then printed to their console

Derma_StringRequest(
	"Console Print", 
	"Input the string to print to console",
	"",
	function(text) print(text) end,
	function(text) print("Cancelled input") end
)

Output:

Derma StringRequest.png
Personal tools
Navigation