onScroll(action: (delta: Vec2)=>void): KEventController
Register an event that runs when mouse wheel scrolled.
paramaction- The function to run when the event is triggered.
// Zoom camera on scroll
onScroll((delta) => {
const zoom = delta.y / 500;
camScale(camScale().add(zoom));
});
returnsThe event controller.
sincev3000.0
groupInput