But I’m pretty confuse about how to use the cc.EventManager and SystemEvent classes I how I use then ?
I have many sprites nodes that I want to make a fixed function callback to touch move for then, I was trying using:
let potion_a = this.potionSprite;
this.potion_a on(‘touchmove’, function(event) {
potion_a.x += event.touch.getDelta().x;
potion_a.y += event.touch.getDelta().y;
/* Act on the event */
}, this.node);
I want that “function that are created inline to be moved to one single static function to manage all inside the canvas class, like
node.on('touchmove”, moveManager(), this.node); … …
////
moveManger : function(events)
{
},
But the game don’t even run with this