bobnobilo Posted August 6, 2018 Share Posted August 6, 2018 Hey guys, am having some trouble with a button that I've implemented with a sprite on touch screens. when the button is pressed, and the user swipes their fingers outside of the bounds of button the pointerout etc event listeners are NOT fired leaving the button in a "pressed" state. This also occurs when the user presses the button on the border. Anyone got any ideas? Link to comment Share on other sites More sharing options...
prob Posted August 6, 2018 Share Posted August 6, 2018 You'd need to post the code in question to get any idea of what's going on. bobnobilo 1 Link to comment Share on other sites More sharing options...
bobnobilo Posted August 7, 2018 Author Share Posted August 7, 2018 Sorry, should of realised that I would have needed to post some code. Here's the button that I've implemented. class Button extends Phaser.GameObjects.Sprite{ constructor(scene, x, y, image){ super(scene, x, y, image); this.isPressed = false; this.setInteractive(); this.on("pointerdown", this.pressed); this.on("pointerup", this.unpressed); this.on("pointerout", this.unpressed); } pressed(){ this.isPressed = true; } unpressed(){ this.isPressed = false } } Any ideas would be appreciated Link to comment Share on other sites More sharing options...
Recommended Posts