Novelty scripting reference > Scripted events > OnMouseWheel


This event is triggered when the user scrolls the mouse wheel.


The mouse coordinates given are relative to the center of the scene. To make them relative to an object or the top left corner of scene use TransformToObjectCoord or TransformToSceneCoord respectively.

Implicit arguments

Object@ sender
Handle to an associated object; or null.

int wheelDelta
The number of ticks that the wheel was rotated. Can be negative.

float mouseX
Horizontal cursor position.

float mouseY
Vertical cursor position.


event Sample.OnMouseWheel
	// Scale an object up or down by increments of 25% 
	sender.scale = sender.scale + wheelDelta * 0.25;

Back to top