RSkene Posted December 6, 2017 Share Posted December 6, 2017 Hi. I have been struggling to get an onInputDown event working on a sprite. I am using phase-ce v2.9.2 (I have tried earlier versions as well with no luck) with webpack for build and within a vuejs application. Below is code I'm using to test events on sprites but this isn't working. class ButtonTest extends Phaser.Sprite { constructor(game, x, y) { super(game, x, y, 'objects', 'd-pad/left'); this.game.stage.addChild(this); this.inputEnabled = true; this.events.onInputDown.add(this.down, this); } down() { console.log('down') } update() { if (this.input.pointerOver()) { console.log('over') } } } export default ButtonTest; It must have something to do with my build because I have tried similar code with a different build and it has worked. The phaser game is only one part of a larger project so I need to continue to use vuejs. Cheers in advanced for any help! Link to comment Share on other sites More sharing options...
Recommended Posts