frozenthrone Posted June 3, 2014 Share Posted June 3, 2014 I want to touch a sprite hold it and drag it to a new point and then release it. How do I implement this? I tried the following code.sprite.inputEnabled = true;sprite.input.start(0, true);sprite.input.enableDrag(false, true, true);It is working perfectly using mouse on desktop but on mobile, first i have to touch the sprite then touch on another position to move the sprite there(No dragging and dropping is done here). I want to touch the sprite to pick it up and without releasing I want to drag and move it to a new position. Please help. Thanks Link to comment Share on other sites More sharing options...
j0hnskot Posted June 3, 2014 Share Posted June 3, 2014 i used the same code (except the input.start line, i dont even know what it does) and it works perfectly.What version of phaser are you using? Link to comment Share on other sites More sharing options...
lokhmakov Posted June 4, 2014 Share Posted June 4, 2014 I want to touch a sprite hold it and drag it to a new point and then release it. How do I implement this? I tried the following code.sprite.inputEnabled = true;sprite.input.start(0, true);sprite.input.enableDrag(false, true, true);It is working perfectly using mouse on desktop but on mobile, first i have to touch the sprite then touch on another position to move the sprite there(No dragging and dropping is done here). I want to touch the sprite to pick it up and without releasing I want to drag and move it to a new position. Please help. ThanksPhaser 2.0.5 working code for you situation:o.inputEnabled = true;o.input.enableDrag(false); Link to comment Share on other sites More sharing options...
Recommended Posts