I've got some sprites in my scene of various different shapes and I want to detect which one the user is currently hovering over, but only when they are hovering over the "visible" parts of a sprite.
It is easy enough to do a bounding box check to see which sprite the mouse is currently over, but the problem is that this doesn't handle transparency. I was trying to think of the best way to handle this and I believe it would be to pull colour information for the sprite, as then I could do a simply check on the pixel co-ordinate to see if the current part of the sprite is transparent or not. If it is transparent then I can ignore it.
I believe what I need is a way to check the material on the atlas for my sprite, but to do that I would need some kind of bounding rectangle that tells me where my sprite is saved on the atlas (I think, but I might be wrong). Is it possible to get this information from the sprite itself?