Adds a listener to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
Fire an event type.
Checks if listener is added to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
Removes a listener from an event type.
The type of the listener that gets removed.
The listener function that gets removed.
A helper class to handle pointer events and dispatch drag events:
drag
,dragStart
anddragEnd
with NDC coordinates and time.To use, create an object of the class, set
element
with the HTML element(like canvas) and add event listeners to drag events.Example