OnMouseWheel
The mouse wheel turned while the player’s cursor is up.
One call a notch: 1 when the wheel turned away from the player (up), -1 towards them (down), with the pointer’s place
in the UI space - for a list or a text that scrolls. The wheel is only observed - it also scrolls a page of the server’s
interface under the pointer - unless the script holds the mouse with SetMouseCapture. While the cursor is down the
wheel is the game’s and nothing is reported.
Syntax
Section titled “Syntax”function OnMouseWheel(delta, x, y) -- ...end| Parameter | Type | |
|---|---|---|
delta |
number | 1 a notch up, -1 a notch down |
x |
number | the pointer’s place across, in the UI space |
y |
number | the pointer’s place down, in the UI space |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”local first = 1 -- the first line of a list shown 10 lines at a timefunction OnMouseWheel(delta, x, y) first = math.max(1, first - delta) drawList(first)endSee also
Section titled “See also”OnMouseButton · SetMouseCapture · the The game’s UI for a script group of the index
