   rundown on 2d picking?
  Ok calculating what tile the mouse is over is cake...what I dont understand is how to figure out what i click on in the scene.So if someone could give me a rundown of doing some 2d picking I would be very greatful.Need to know if i click on a UI element...or a sprite....   
  I will go ahead and make mention that I've looked around and see a lot of information about picking in 3d space....but i see very little about picking in a 2d environment.   ;  what I've come up with so far...Ok each object will have a bounding box...I will have the anchor point of each object so ill be able to use that as a starting point for my bounding box.when i see a mouse click im going to zip through all of my renderd sprites/ui elements and check the mouse position against the transformed bounding box.am i doing too much work here or does this sound about right?   ;Quote:Original post by nex7what I've come up with so far...Ok each object will have a bounding box...I will have the anchor point of each object so ill be able to use that as a starting point for my bounding box.when i see a mouse click im going to zip through all of my renderd sprites/ui elements and check the mouse position against the transformed bounding box.am i doing too much work here or does this sound about right?For the user interface, this is the right way. For tiles, you can use the simple math you mentioned. For sprites, there is a simple way. If you have an occupancy slot that stores the object id instead of a single bit in your map structure, so you know if a tile is in use by a mobile object, you can use that for picking. However imho using the simple iteration is easier and more precise. If you use this map based sprite selection and miss the object but hit the tile it's partially covering, you will still select it. This is what happened in warcraft1-2. On the other side, this is much faster than the iterative way.Viktor   ;  Is your UI on top of the map or near it? Generally I have a bounding box that contains all of my on screen UI boxes in parent->child relationships. I check the UI boxes first since if it isn't just off to one side or the top or bottom it is always on top of the map. I would have to kill that portion of the UI on top of the map for it to not be valid so I know pretty quickly if it belongs to the UI or the map.Hope it helps.;  Great thanks a lot guys...i think i can mix and match the suggestions to come up with something nice.I am so used to working with a team at work it's not in my nature to just start writing without checking my solutions against others....thanks again   