Jump to content

Drag sprite on right mouse button only


iliak
 Share

Recommended Posts

Thank you samme...  You lead me to the right track !

The right answer is :

let image = new Phaser.Game(....)

let file = image.add.sprite(0, 0, 'file');
file.inputEnabled = true;

// Enable drag only on right mouse button
image.input.mousePointer.rightButton.onDown.add(function(){
	file.input.enableDrag(false);
});
image.input.mousePointer.rightButton.onUp.add(function(){
	file.input.disableDrag();
});

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...