onMouseMove(action: (pos: Vec2, delta: Vec2)=>void): KEventController

Register an event that runs whenever user moves the mouse.

paramaction- The function that is run what the user moves the mouse.

// runs when the mouse has moved
onMouseMove((p, d) => {
    bean.pos = p; // set bean position to mouse position
});

returnsThe event controller.

sincev2000.1

kaplay logo

Misc

Layer