Novelty scripting reference > Scripted events > OnMouseWheel

OnMouseWheel

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

Remarks:

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.


Sample

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

Back to top