Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Remove Input is enabled on transparent part of the sprite


marbleTT
 Share

Recommended Posts

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...