DgsSetMouseStayDelay: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client function}} __NOTOC__ This function sets the delay time that from mouse stops moving and cursor stays at a DGS element to onDgsMouseStay event triggers. ==Syntax== <syntaxhighlight lang="lua"> bool dgsSetMouseStayDelay( int interval ) </syntaxhighlight> ===Required Arguments=== *'''delay:''' An int of the delay time. ===Returns=== Returns ''true'' if successful, ''false'' otherwise ==Example== <syntaxhighlight lang="lua"> DGS = exports.dgs DGS:dgsSetMou...")
 
 
Line 21: Line 21:
local label = DGS:dgsCreateLabel(200,200,100,50,"Test Label",false)
local label = DGS:dgsCreateLabel(200,200,100,50,"Test Label",false)
addEventHandler("onDgsMouseStay",label,function()
addEventHandler("onDgsMouseStay",label,function()
outputChatBox("Stay triggered")
outputChatBox("Stay Triggered")
end)
end)
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 11:28, 24 December 2022

This function sets the delay time that from mouse stops moving and cursor stays at a DGS element to onDgsMouseStay event triggers.

Syntax

bool dgsSetMouseStayDelay( int interval )

Required Arguments

  • delay: An int of the delay time.

Returns

Returns true if successful, false otherwise

Example

DGS = exports.dgs
DGS:dgsSetMouseStayDelay(5000) --Set to 5s

local label = DGS:dgsCreateLabel(200,200,100,50,"Test Label",false)
addEventHandler("onDgsMouseStay",label,function()
	outputChatBox("Stay Triggered")
end)

See Also

General Functions

General Events