|
-
January 4th, 2010, 09:46 PM
#4
Re: Mouse hit test/know when mouse is over something.
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|