Game Editor - When screen is clicked, how do you identify which object that is clicked?

Posted by Deukalion on Game Development See other posts from Game Development or by Deukalion
Published on 2012-06-29T11:29:58Z Indexed on 2012/06/29 15:24 UTC
Read the original article Hit count: 251

Filed under:
|
|
|
|

I'm trying to create a Game Editor, currently just placing different types of Shapes and such. I'm doing this in Windows Forms while drawing the 3D with XNA. So, if I have a couple of Shapes on the screen and I click the screen I want to be able to identify "which" of these objects you clicked.

What is the best method for this? Since having two objects one behind the other, it should be able to recognize the one in front and not the one behind it and also if I rotate the camera and click on the one behind it - it should identify it and not the first one.

Are there any smart ways to go about this?

© Game Development or respective owner

Related posts about XNA

Related posts about c#