Akamatsu Posted March 27, 2015 Share Posted March 27, 2015 Hello guys, I have a little problem. How to change the 'pointerDown' in Right Click only?if (VUchoice.input.pointerDown()) { VU1choice=this.add.sprite(623,744,'choicevulture'); VU1choice.anchor.setTo (0.5,0.5); J1 = 1; } Link to comment Share on other sites More sharing options...
MichaelD Posted March 27, 2015 Share Posted March 27, 2015 Try Phaser.Mouse.RIGHT_BUTTONMore info here: http://phaser.io/docs/2.3.0/Phaser.Mouse.html#RIGHT_BUTTON Link to comment Share on other sites More sharing options...
Akamatsu Posted March 27, 2015 Author Share Posted March 27, 2015 I already see that but i don't understand how to integrate this line in my code Link to comment Share on other sites More sharing options...
MichaelD Posted March 27, 2015 Share Posted March 27, 2015 You can do something like the followinggame.input.mouse.mouseDownCallback = function(e){ if(game.input.mouse.button === Phaser.Mouse.RIGHT_BUTTON) { } }; Link to comment Share on other sites More sharing options...
Akamatsu Posted March 27, 2015 Author Share Posted March 27, 2015 Nice i did if (VUchoice.input.pointerDown ()) { if(this.input.mouse.button === Phaser.Mouse.RIGHT_BUTTON) { VU1choice=this.add.sprite(623,744,'choicevulture'); VU1choice.anchor.setTo (0.5,0.5); J1 = 1; } }And that work ! Thank you for fast and clear answer MichaelD 1 Link to comment Share on other sites More sharing options...
MikaelMattsson Posted August 23, 2016 Share Posted August 23, 2016 this.game.input.mousePointer.rightButton.onDown.add(this.onRightDown, this) Link to comment Share on other sites More sharing options...
Recommended Posts