DgsSwitchButtonSetText

From Multi Theft Auto: Wiki
Revision as of 09:07, 22 April 2020 by Temois (talk | contribs) (Created page with "==Syntax== <syntaxhighlight lang="lua"> bool dgsSwitchButtonSetText( element switchbutton, string textOn, string textOff) </syntaxhighlight> ===Required Arguments=== *'''s...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Syntax

bool dgsSwitchButtonSetText( element switchbutton, string textOn, string textOff)

Required Arguments

  • switchButton: Switch you wish to change the text of
  • textOn: New text
  • textOff: New text

Returns

Returns true if text has been changed successfully, false otherwise.

Example

DGS = exports.dgs
button = DGS:dgsCreateSwitchButton( 0.7, 0.1, 0.2, 0.1, "On", "Off", false, true )
addCommandHandler("switch", function()
    DGS:dgsSwitchButtonSetText(button, "Turn", "Shutdown")
end)