DgsSetProperties: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client function}} __NOTOC__ This function sets the value of a specific property of a DGS element. For a list of properties and their meaning, see the template:DGSPROPERTIE...")
 
(Blanked the page)
Line 1: Line 1:
{{Client function}}
__NOTOC__
This function sets the value of a specific property of a DGS element. For a list of properties and their meaning, see the [[template:DGSPROPERTIES | DGS properties page]].


'''Note: If you push a value improperly, errors or warnings will occur, which may cause lag and debug info spamming.'''
==Syntax==
<syntaxhighlight lang="lua">
string dgsDxGUISetProperty ( element dgsElement, string property, mixed value [, mixed arg1, mixed arg2 ... ] )
</syntaxhighlight>
===Required Arguments===
*'''dgsElement:''' the DGS element you wish to set a property to.
*'''property:''' the name of of property you want the value to.
*'''value:''' the value you want to set.
===Optional Arguments===
*'''arg...:''' extra value of some properties.
===Returns===
If the function succeeds, it returns true, false otherwise.
==Example==
This example creates a label whose text can be changed by itself.
<syntaxhighlight lang="lua">
DGS = exports.dgs
button = DGS:dgsDxCreateLabel(20, 200, 150, 30, "Test", false)
code = "return getTickCount()"
DGS:dgsDxGUISetProperty(button, "functions", code)
</syntaxhighlight>
==See Also==
{{DGSFUNCTIONS}}

Revision as of 16:45, 2 January 2018