DgsSwitchButtonGetText: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client function}} ==Syntax== <syntaxhighlight lang="lua"> bool dgsSwitchButtonGetText( element switchButton ) </syntaxhighlight> ===Required Arguments=== *'''switchButto...")
(No difference)

Revision as of 14:56, 22 April 2020

Syntax

bool dgsSwitchButtonGetText( element switchButton )

Required Arguments

  • switchButton: Switch you want to get text from.

Returns

Returns a text of the Switch Button.

Example

DGS = exports.dgs
button = DGS:dgsCreateSwitchButton( 0.7, 0.1, 0.2, 0.1, "On", "Off", true, true )
addEventHandler ( "onDgsMouseClickDown", button, function()
    local textOn, textOff = DGS:dgsSwitchButtonGetText(button)
    outputChatBox ( textOn)
    outputChatBox ( textOff)
end)