Given an event, return all intersected items from the given clientX
and clientY
coordinates. By default, it returns all intersected points, but you can turn off recursive
mode to return only the first intersected item.
Example
const event = { clientX: 500, clientY: 500 }; // sample event
$$$.pickFromEvent(event); // returns an array of intersected points
// a useful debugging tool of using events and picking to grab intersected items
$$$.on('mousemove', (event) => {
console.log($$$.pickFromEvent(event)); // logs all intersected items on `mousemove`
});