Gregory Posted December 11, 2014 Share Posted December 11, 2014 Hi, I need to track the pointer position when someone is holding and moving his finger.I tried a combination of things but none work. Here is 2 that does not work: Listening to events: this.drawing = this.game.add.sprite(0, 0, this.bmd); this.drawing.inputEnabled = true; this.drawing.events.onInputUp.add(this.onInputUp, this); this.drawing.events.onInputDown.add(this.onInputDown, this);onInputDown is not trigger while the finger is moving Checking bool on update:http://www.html5gamedevs.com/topic/1764-how-to-capture-a-touch-event-on-mobile-device/?p=24440update: function(){ for (var i = 1; i <= 10; i++) { if (this.game.input["pointer" + i]) console.log( this.game.input["pointer" + i].isDown ); };This is always false. I am out of ideas, does anymore knows how to do what I need?Thanks, Link to comment Share on other sites More sharing options...
JUL Posted December 12, 2014 Share Posted December 12, 2014 When all else failed... Go for brute force ! update: function(){ if(game.input.activePointer.isDown){console.log(' x: '+game.input.worldX+' y: '+game.input.worldY);} }; Link to comment Share on other sites More sharing options...
Gregory Posted December 12, 2014 Author Share Posted December 12, 2014 update: function(){ if(game.input.activePointer.isDown){console.log(' x: '+game.input.worldX+' y: '+game.input.worldY);} }; This also doesnot work on touch devices. Link to comment Share on other sites More sharing options...
Gregory Posted December 12, 2014 Author Share Posted December 12, 2014 Ok so it actually works but it does not in the Chrome Touch Simulator which is fine. Link to comment Share on other sites More sharing options...
Recommended Posts