mouseWheel

v0.1.6
mouseWheel(button);Event

Called when a mouse wheel is used

Arguments

buttonThe pressed mouse button


In the following example, the circle's size changes when the user scrolls

size = 0;

function setup()
  createWindow(400, 400);
end

function draw()
  background(51);

  circle(mouseX, mouseY, size);
end

-- Change circle size when mouse is scrolled
function mouseWheel(delta)
  size = size + delta;
end
See mouseWheel in mouse.h