iliak Posted January 6, 2017 Share Posted January 6, 2017 Hello Is it possible to activate drag on a sprite with the right mouse button only, and not any button ? Link to comment Share on other sites More sharing options...
samme Posted January 7, 2017 Share Posted January 7, 2017 I don't know a way to do this directly. You can try `rightButton` doesn't work for me at all in Safari. Link to comment Share on other sites More sharing options...
iliak Posted January 7, 2017 Author Share Posted January 7, 2017 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 More sharing options...
samme Posted January 7, 2017 Share Posted January 7, 2017 This way works for me in Safari. You have to listen to `leftButton.onDown` and the value in `deviceButton.event.button` is either 0 (left) or 2 (right!). Link to comment Share on other sites More sharing options...
Recommended Posts