The game I’m creating doesn’t require any physics, however you are able to interact when hovering over/clicking on the sprite by using sprite.setInteractive({cursor: "pointer"});
, sprite.on('pointermove', function(activePointer) {...});
and similar. However I noticed two issues with that:
-
The sprite has some area which are transparent. The interactive functions will still trigger when clicking on those transparent areas, which is unideal.
-
When playing a sprite animation, the interactive area doesn’t seem to entirely (at all?) change, thus if the sprite ends on a frame bigger than the previous, there end up being small areas I can’t interact with.
One option I thought of was to create a polygon over my sprite, which covers the area I want to be interactive. However before I do that, I simply wanted to ask if there are simpler ways to fix these issues.