DgsGetProperty

From Multi Theft Auto: Wiki

This function gets the value of a specific property of a DGS element. For a list of properties and their meaning, see the DGS properties page.

Syntax

string dgsGetProperty ( element dgsElement, string property )

Required Arguments

  • dgsElement: the DGS element you wish to get a property of.
  • property: the name of of property you want the value of.

Returns

If the function succeeds, it returns a value of the property. An error will occur if failed.

Example

This example creates a button when the resource starts and defines a console command that toggles it between enabled (clickable) and disabled (not clickable).

DGS = exports.dgs
button = DGS:dgsCreateButton(20, 200, 150, 30, "Test", false)

addCommandHandler("togglebtn",function()
	local currentState = DGS:dgsGetProperty(button, "enabled")
	DGS:dgsSetProperty(button, "enabled", not currentState)
end)

See Also

Multi Language Supports

Animation

3D Interface

3D Text

Arrow List

Browser

Button

Check Box

Combo Box

Edit

Ellipse Detect Area

Detect Area

Grid List

Image

Memo

Label

Progress Bar

Radio Button

Scroll Bar

Scroll Pane

Switch Button

Tab Panel

Window

Plugin

Media Browser

Rounded Rectangle

Color Picker

Blur Box

Effect 3D