OnDgsMouseMultiClick: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Undo revision 68876 by Thisdp (talk))
Tag: Undo
 
Line 2: Line 2:
__NOTOC__
__NOTOC__
This event occurs when multi clicking on any dgs-element.
This event occurs when multi clicking on any dgs-element.
{{Note|This event will not trigger when [[onDgsMouseClick]] is cancelled.}}
{{Note|This event will not trigger when [[onDgsMousePreClick]] is cancelled.}}


==Parameters==  
==Parameters==  
Line 22: Line 22:
DGS = exports.dgs
DGS = exports.dgs


button = DGS:dgsCreate
button = DGS:dgsCreateButton(0.3, 0.3, 0.1, 0.05, "Button", true)
 
addEventHandler( "onDgsMouseMultiClick", button, function(button, state, x, y, times)
if button == 'left' and state == 'up' then
outputChatBox("You clicked " .. times .." times")
end
end)
</syntaxhighlight>
 
==See Also==
===DGS events===
{{DGSEVENTS}}
===Client event functions===
{{Client_event_functions}}

Latest revision as of 14:19, 16 February 2021

This event occurs when multi clicking on any dgs-element.

[[{{{image}}}|link=|]] Note: This event will not trigger when onDgsMousePreClick is cancelled.

Parameters

string button, string state, int absoluteX, int absoluteY, int times
  • button: The name of the button which will be clicked , it can be left, right, middle
  • state: The state of the mouse button. Can be down or up. ( Please note that both up and down state are supported! )
  • absoluteX: The X position of the mouse cursor, in pixels, measured from the left side of the screen.
  • absoluteY: The Y position of the mouse cursor, in pixels, measured from the top of the screen.
  • times: An int of the clicking times.

Source

The source of this event is the DGS element that was multi clicked.

Example

This example creates a text button and clicking on it will tell you the position coordinates of the mouse cursor:

DGS = exports.dgs

button = DGS:dgsCreateButton(0.3, 0.3, 0.1, 0.05, "Button", true)

addEventHandler( "onDgsMouseMultiClick", button, function(button, state, x, y, times)
	if button == 'left' and state == 'up' then
		outputChatBox("You clicked " .. times .." times")
	end
end)

See Also

DGS events

General

Check Box

Combo Box

Drag'N Drop

Edit

Grid List

Menu

Selector

Mouse

Radio Button

Switch Button

Tab

Animation

Plugin

Media

Color Picker

QRCode

Remote Image

Client event functions