marbleTT Posted August 24, 2015 Share Posted August 24, 2015 I don't know why the transparent part of the sprite is clickable. It is a child of another sprite but I don't know if that is the reason why but this is what I have for the code.var sprite = new Phaser.Sprite(_this.game, 0, 0, 'door');sprite.y = value.y;sprite.x = value.x;sprite.angle = '+34';sprite.inputEnabled = true;sprite.input.pixelPerfectClick = true;sprite.input.useHandCursor = true;sprite.input.enableDrag();sprite.events.onInputOver.add(over, this);function over(sprite, pointer) {console.log(sprite);console.log(pointer);}this.addChild(sprite)I have tried all the example codes that are out there and the sprite doesn't take input response on the transparent part's of the image but for some reason it is here. Could someone explain why this would be happening and how to fix it? Link to comment Share on other sites More sharing options...
rich Posted August 25, 2015 Share Posted August 25, 2015 You've enabled pixelPerfectClick - but that only checks the transparent areas on *click*. Your code is checking for an Over event. So you need 'pixelPerfectOver' instead (or as well as click, depending on the game) Link to comment Share on other sites More sharing options...
Recommended Posts