Archived

This topic is now archived and is closed to further replies.

Stopping the mouse

This topic is 5516 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, heres the thing. In my game I''ve got everythign set up and I''m just about ready to start on A.I. and stuff, but the mouse won''t stop at the edge of the screen. I''ve tested for hitting the bounds of the screen, and even out to 30 pixels away from the edge on the top and bottom, but the mouse moves more than 30 pixels per frame. So I was wondering if there was some technique I didn''t know about or something. Thanks. Hibiki Wheres the any key?

find your element at mutedfaith.com. <º>

Share this post


Link to post
Share on other sites
If you''re talking about your in-game cursor, why not something like
if(cursor.x_pos > screen_max_x_pos)
cursor.x_pos = screen_max_x_pos;
etc.?

If Win32 cursor, you can grab the current mouse pos at the beginning and use SetCursorPos (IIRC) to set it back to that position every frame, taking the difference between that point and where it has moved to and using those coordinates as the movement vector.

Ask if you need implementation details.

Peace,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

Share this post


Link to post
Share on other sites