Windows Mouse Input

so I'm reading in mouse input using GET_X_LPARAM(lParam) and GET_Y_LPARAM(lParam), and when I click on a "button" (or just any image) it seems as if the "hit box" is a bit low and off to the right, if that makes sense.

Every time the left button is pressed, it loops through all of my objects looking to see if a object was clicked on. the way I'm checking that is taking the objects position, subtracting the camera and then checking if it's in between the sides by adding and subtracting half of it's size.

I don't really know how else to explain it, it'd probably be better understood if seen. is there some weird offset or something from the actually mouse cursor?

any help on this would be much appreciated.
The origin of a button is its top left corner. It sounds like your hit test rectangle is misplaced. Prob by half the width and half the height?
Last edited on
it seems as if y was down about 20 pixels and x was to the right about 20 pixels.
don't really know why.
the origin of my button is the middle. it's just a image draw with directx via shaders.
if i just hard code the 20 pixels into the equation it works better but it still bugs me.
Ah, ok. SOrry about the dopey question: all my buttons are of the top-left variety.

Have you asked on a games forum, where people should know all about shaders??
no not yet. I don't know of a game forum, people are usually really helpful on here, I've never not had a question answered, but i'll take a look at posting this question on a different forum. the more and more I play with my little hack of a fix the more "acceptable" it becomes but it's just not exact to the pixel
Well, cplusplus.com is a C++ forum.

For more more arcane game related questions, I visit gamedev.net:
http://www.gamedev.net/index
Topic archived. No new replies allowed.