The event type for which the object is registering
melonJS currently supports:
"pointermove"
"pointerdown"
"pointerup"
"pointerenter"
"pointerover"
"pointerleave"
"pointercancel"
"wheel"
a shape representing the region to register on
methods to be called when the event occurs.
Returning false
from the defined callback will prevent the event to be propagated to other objects
input
// onActivate function
onActivateEvent: function () {
// register on the 'pointerdown' event
me.input.registerPointerEvent('pointerdown', this, (e) => this.pointerDown(e));
},
// pointerDown event callback
pointerDown: function (pointer) {
// do something
....
// don"t propagate the event to other objects
return false;
},
allows registration of event listeners on the object target.
melonJS will pass a me.Pointer object to the defined callback.