Moving Objects with a Mouse
Posted on 1998-06-18
I have made some menu selections that when chosen an object such as a rectangle or circle appear on the view screen for the user. I want the user to be able to select an object on the screen and then move it around. I am currently trying to do this by checking if an object is in a rectangular region located at the cursor when the user clicks the left mouse button. If it is then I change the location of the object based on the cursor's location as the user moves it. However, I have not been successful in checking to see if the object is in the cursor location (when the user is trying to grab the object). I know how to move the object. I just can't grab it.
Some info (code preferable) on how to check whether the cursor is pointing to an object on the screen when the user is trying to grab the object is what I need.