kaplay
kaplay copied to clipboard
feat: Include input events to `obj.clearEvents()`
Is your feature request related to a problem? Please describe.
If you do something like
obj.onMousePress("left", () => {
debug.log("hello")
})
obj.clearEvents()
The onMousePress will still work despite onMousePress "being cleared" from the object, this clearEvents only works onUpdate and onDraw afaik
The event DOES get cleared when the object is destroyed i think, so i don't know why it happens this way
I works on all event except for input events. This is because input events are actually global and objects only hold a reference to the event, not the actual event.
Is there a reason why this is done this way?
Only tga knows, and tga didn't wrote comments why.