@Gama11 Thanks Gama11,
But that will treat the sprite as a rectangular box, so it's not accurate for complex shapes.
I attached a screenshot. Is it possible to make the areas with magenta color invisible and still detect when the mouse is over them?