OnClientMouseLeave: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: {{Client event}} __NOTOC__ This event is fired when the user moves the mouse away from a GUI element. ==Parameters== <syntaxhighlight lang="lua"> int absoluteX, int absoluteY </syntaxhighlight> * '''absoluteX''...)
 
 
(6 intermediate revisions by 4 users not shown)
Line 5: Line 5:
==Parameters==  
==Parameters==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
int absoluteX, int absoluteY
int absoluteX, int absoluteY, element enteredGUI
</syntaxhighlight>  
</syntaxhighlight>  
* '''absoluteX''':  the X position of the mouse cursor, in pixels, measured from the left side of the screen.
* '''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.
* '''absoluteY''':  the Y position of the mouse cursor, in pixels, measured from the top of the screen.
* '''enteredGUI''': is the GUI element that was switched from, or ''nil'' if it doesn't exist.
==Source==
==Source==
The [[event system#Event source|source]] of this event is the GUI element that the mouse was moved from.
The [[event system#Event source|source]] of this event is the GUI element that the mouse was moved from.
Line 15: Line 17:
This example shows a message when you move the mouse away from a GUI element.
This example shows a message when you move the mouse away from a GUI element.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addEventHandler('onClientMouseLeave', getRootElement(), function(aX, aY)
addEventHandler("onClientMouseLeave", getRootElement(), function(aX, aY)
     outputChatBox("You're no longer pointing at a GUI element at (" .. tostring(aX) .. ', ' .. tostring(aY) .. ')')
     outputChatBox("You're no longer pointing at a GUI element at (" .. tostring(aX) .. ", " .. tostring(aY) .. ")")
end)
end)
</syntaxhighlight>
</syntaxhighlight>
[[pl:onClientMouseLeave]]


==See Also==
==See Also==
===GUI events===
{{GUI_events}}
{{GUI_events}}
===Client event functions===
===Client event functions===
{{Client_event_functions}}
{{Client_event_functions}}

Latest revision as of 14:32, 20 May 2018

This event is fired when the user moves the mouse away from a GUI element.

Parameters

int absoluteX, int absoluteY, element enteredGUI
  • 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.
  • enteredGUI: is the GUI element that was switched from, or nil if it doesn't exist.

Source

The source of this event is the GUI element that the mouse was moved from.

Example

This example shows a message when you move the mouse away from a GUI element.

addEventHandler("onClientMouseLeave", getRootElement(), function(aX, aY)
    outputChatBox("You're no longer pointing at a GUI element at (" .. tostring(aX) .. ", " .. tostring(aY) .. ")")
end)

See Also

Input

GUI


Client event functions