DgsGetElementsFromResource: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
table dgsGetDxGUIFromResource( [ resource-data res ] )
table dgsGetDxGUIFromResource( [ resource res ] )
</syntaxhighlight>
</syntaxhighlight>


===Required Arguments===  
===Required Arguments===  
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type -->
None
*'''guiElement:''' element you wish to get text of.
===Optional Arguments===
*'''res:''' The resource which DGS elements were created by.


===Returns===
===Returns===
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check -->
Returns a table containing DGS elements which were created by the resource, false otherwise.
Returns a string containing the requested element's text, or false if the dgs element passed to the function is invalid.


==Example==  
==Example==  
<!-- Explain what the example is in a single sentance -->
This example gets the text of a pre-made dgs element and outputs it to chat box.
This example gets the text of a pre-made dgs element and outputs it to chat box.
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized -->
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
DGS = exports.dgs
DGS = exports.dgs
Line 29: Line 27:


==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 -->
{{DGSFUNCTIONS}}
{{DGSFUNCTIONS}}

Revision as of 03:47, 31 August 2017

This function is used to get DGS elements which were created by other resources.

Syntax

table dgsGetDxGUIFromResource( [ resource res ] )

Required Arguments

None

Optional Arguments

  • res: The resource which DGS elements were created by.

Returns

Returns a table containing DGS elements which were created by the resource, false otherwise.

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:dgsDxCreateLabel ( 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:dgsDxGUIGetText ( dummyGUIElement ) )

See Also

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips