The technique that you want is called picking. Basically, you need to draw everything twice, once on the screen in real colour, and again on a picking buffer in a solid, unique colour. When the mouse button goes goes, check it's position, check which colour is on the picking buffer at that coordinate, and it'll tell you which object was clicked on. It's the best for things that are arbitrarily rotated or have a lot of objects, because it's pixel perfect.