Related Discussions
...

Hi,
working in the game editor, I need to do a selection tool
I need two step:
1- check if mouse is over a skeleton, and I just have do it
2- check if the pixel under the mouse is transparent o colored

because if I click in a transparent area I do not select the skeleton.
is there a practical way to do this with spine runtime?

or alternatively I thought of drawing the selected skeleton in a RenderTarget2D and reading the pixel color afterwards.
suggestions from you?
best
Cristian

If you really need to check pixels, likely the best thing to do is render to a buffer and check the buffer.

It is very rare to need pixel accurate hit detection. Likely the best thing to do is use circles or rectangles. You could use Spine's bounding boxes for more accuracy, though again it is very rare that is needed. You could even do hit detection with the vertices of each attachment, but hit detection often uses different bounds than the attachments.

HI Nate,
look this video at 1:30 https://youtu.be/B1F6fi04qw8?t=92
I'm creating a similar editor, I'm working with Spine in 3D environment for creating a great paralaxx and other effect.
I need to move a object only when click in colored area (or near), not if transparent. Then I think I render to a dedicate buffer as you reply


ok just do it.
Easy way: when the mouse click over a skeleton, I found all the skeleton under the mouse coordinate, then I render every skeleton to a separate buffer and i check for the pixel color in this coordinate :-)