OnMouseMove
The player’s cursor moved.
The pointer’s new place in the UI space (GetScreenSize: 1080 rows high), at most once a frame while the cursor is
up - the first place as the cursor comes up, then every move. For hover effects and drags in a menu of the script’s own;
GetCursorPosition reads the same place at any moment.
Syntax
Section titled “Syntax”function OnMouseMove(x, y) -- ...end| Parameter | Type | |
|---|---|---|
x |
number | the pointer’s place across, in the UI space |
y |
number | the pointer’s place down, in the UI space (0 at the top, 1080 at the bottom) |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”-- a button that lights up under the pointerfunction OnMouseMove(x, y) local over = x >= 100 and x <= 300 and y >= 900 and y <= 960 SetUiAlpha("door_btn", over and 100 or 70)endSee also
Section titled “See also”GetCursorPosition · OnMouseButton · OnCursorChange · the The game’s UI for a script group of the index
