DgsGetText: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(DGS (OOP Syntax)/(Template Organization) Mission)
Line 9: Line 9:
string dgsGetText ( element guiElement )
string dgsGetText ( element guiElement )
</syntaxhighlight>
</syntaxhighlight>
{{DGS/OOP||DGSElement:getText||text|dgsSetText}}


===Required Arguments===  
===Required Arguments===  
Line 30: Line 31:
</syntaxhighlight>
</syntaxhighlight>


==See Also==
=See Also=
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
{{DGSFUNCTIONS}}
==<span style="color:#eb3f00;text-shadow:0.05em 0.05em 0.2em #00000099;">General Functions</span>==
{{DGS General Functions}}
 
==<span style="color:#eb3f00;text-shadow:0.05em 0.05em 0.2em #00000099;">General Events</span>==
{{DGS Events/General}}

Revision as of 18:24, 19 April 2021

This function is used to get the text of DGS elements like edit boxes, labels, buttons etc.

Syntax

string dgsGetText ( element guiElement )

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

Required Arguments

  • guiElement: element you wish to get text of.

Returns

Returns a string containing the requested element's text, or false if the dgs element passed to the function is invalid.

Example

This example gets the text of a pre-made dgs element and outputs it to chat box.

DGS = exports.dgs
-- We create a dummy dgs label to get text of
local dummyGUIElement = DGS:dgsCreateLabel ( 0.45, 0.48, 0.10, 0.04, "Hello world", true )
-- Output the text of the label to chat box
outputChatBox ( "Text in the DGS label: " .. DGS:dgsGetText ( dummyGUIElement ) )

See Also

General Functions

General Events