DgsGetProperties: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(DGS (OOP Syntax)/(Template Organization) Mission)
m (DGS OOP Syntax changing)
 
Line 7: Line 7:
table dgsGetProperties ( element dgsElement [, table properties ] )
table dgsGetProperties ( element dgsElement [, table properties ] )
</syntaxhighlight>
</syntaxhighlight>
{{DGS/OOP||DGSElement:getProperties|||dgsSetProperties}}
{{DGS/OOP|
    Method = DGSElement:getProperties|
    Counterpart = dgsSetProperties
}}


===Required Arguments===
===Required Arguments===

Latest revision as of 21:00, 3 May 2021

This function gets the values of secific properties or all the properties of a DGS element. For a list of properties and their meaning, see the DGS properties page.

Syntax

table dgsGetProperties ( element dgsElement [, table properties ] )

DGS OOP Syntax Help! I don't understand this!

Method: DGSElement:getProperties(...)
Counterpart: dgsSetProperties

Required Arguments

  • dgsElement: the DGS element you wish to set a property to.

Optional Arguments

  • properties: a table stores the properties name you want to get.

Returns

returns a table stores property name and value if succeeds, false otherwise.

Example

This example shows how to set multi properties at a time.

DGS = exports.dgs
button = DGS:dgsCreateLabel(20, 200, 150, 30, "Test", false)
properties = {"text","textcolor"}
local data = DGS:dgsGetProperties(button, properties)
for k,v in pairs(data) do
	outputChatBox(k.." = "..tostring(v))
end

See Also

DGS Properties

General Properties

Unique Properties For DGS Core Elements

Extra Properties For DGS Plugins

General Functions

General Events