OnClientMouseEnter: Difference between revisions
Jump to navigation
Jump to search
(5 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 leftGUI | ||
</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. | ||
* '''leftGUI''': 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 was pointed at. | The [[event system#Event source|source]] of this event is the GUI element that was pointed at. | ||
Line 15: | Line 17: | ||
This example shows a message when you move over a GUI element. | This example shows a message when you move over a GUI element. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addEventHandler( "onClientMouseEnter", | addEventHandler( "onClientMouseEnter", root, | ||
function(aX, aY) | function(aX, aY) | ||
outputChatBox( "You're pointing at a GUI element at ("..tostring(aX)..", "..tostring(aY)..")") | outputChatBox( "You're pointing at a GUI element at ("..tostring(aX)..", "..tostring(aY)..")") | ||
Line 21: | Line 23: | ||
) | ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[pl:onClientMouseEnter]] | |||
==See Also== | ==See Also== | ||
{{GUI_events}} | {{GUI_events}} | ||
===Client event functions=== | ===Client event functions=== | ||
{{Client_event_functions}} | {{Client_event_functions}} |
Latest revision as of 12:50, 27 October 2023
This event is fired when the user moves the mouse over a GUI element.
Parameters
int absoluteX, int absoluteY, element leftGUI
- 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.
- leftGUI: 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 was pointed at.
Example
This example shows a message when you move over a GUI element.
addEventHandler( "onClientMouseEnter", root, function(aX, aY) outputChatBox( "You're pointing at a GUI element at ("..tostring(aX)..", "..tostring(aY)..")") end )
See Also
Input
GUI
- onClientGUIAccepted
- onClientGUIBlur
- onClientGUIChanged
- onClientGUIClick
- onClientGUIComboBoxAccepted
- onClientGUIDoubleClick
- onClientGUIFocus
- onClientGUIMouseDown
- onClientGUIMouseUp
- onClientGUIMove
- onClientGUIScroll
- onClientGUISize
- onClientGUITabSwitched
- onClientMouseEnter
- onClientMouseLeave
- onClientMouseMove
- onClientMouseWheel
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled