DgsSetMultiClickInterval: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(DGS (OOP Syntax)/(Template Organization) Mission)
No edit summary
Line 22: Line 22:
DGS = exports.dgs
DGS = exports.dgs
DGS:dgsSetMultiClickInterval(1000) -- Now, 2 clicks in 1 second will trigger double click event.
DGS:dgsSetMultiClickInterval(1000) -- Now, 2 clicks in 1 second will trigger double click event.
local label = DGS:dgsCreateLabel(200,200,100,50,"Test Label",false)
addEventHandler("onDgsMouseDoubleClick",label,function(button,state)
if state == "down" then
outputChatBox("Double Click Triggered")
end
end)
</syntaxhighlight>
</syntaxhighlight>



Revision as of 11:28, 24 December 2022

This function sets the interval among (n) times clicks.

Syntax

bool dgsSetMultiClickInterval( int interval )

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

Method: dgsRootInstance:setMultiClickInterval(...)
Counterpart: dgsGetMultiClickInterval

Required Arguments

  • interval: An int of the interval among clicks (ms).

Returns

Returns true if successful, false otherwise

Example

DGS = exports.dgs
DGS:dgsSetMultiClickInterval(1000) -- Now, 2 clicks in 1 second will trigger double click event.


local label = DGS:dgsCreateLabel(200,200,100,50,"Test Label",false)
addEventHandler("onDgsMouseDoubleClick",label,function(button,state)
	if state == "down" then
		outputChatBox("Double Click Triggered")
	end
end)

See Also

General Functions

General Events