dxinput mouse question
How can i get the screen coordinates with directinput ?
*im using dx8*
As it is now i only recv the offset from the last input
i pluss this with my cursor pos to get a picture of where i am on the screen. this works fine for moving the cursor but not for collition detection
You define where the mouse is since it has no idea that the screen even exists. Call some point on the screen (probably the top left corner) to place your mouse initially, call it point (0, 0) ,and then reference all mouse moves from that point.
Using that, when your mouse has a net movement of (400, 30) you know that the screen coordinate is (400, 30).
Colin Jeanne | Invader''s Realm
Using that, when your mouse has a net movement of (400, 30) you know that the screen coordinate is (400, 30).
Colin Jeanne | Invader''s Realm
Also, if you''re having lots of problems with that, you can also use the Windows API function GetCursorPos.
.bas
[sPiKie] mmorpg isnt hard in vb
so how do i detect mouse clicks with GetCursorPos() ?
Invader X:
How would you go around doing that ?
or what ?
Invader X:
How would you go around doing that ?
int x = 0;int y = 0;//now in my update input function that gets called every framex += m_MouseState.lX;y += m_MouseState.lY;
or what ?
quote:Original post by logout
Invader X:
How would you go around doing that ?int x = 0;int y = 0;//now in my update input function that gets called every framex += m_MouseState.lX;y += m_MouseState.lY;
or what ?
Exactly like that. If you find that the mouse is too sensitive or not sensitive enough you can make the equations a bit more complex. Windows, for example, simulates acceleration when it decides the mouse position.
Colin Jeanne | Invader''s Realm
quote:Original post by Invader Xquote:Original post by logout
Invader X:
How would you go around doing that ?int x = 0;int y = 0;//now in my update input function that gets called every framex += m_MouseState.lX;y += m_MouseState.lY;
or what ?
Exactly like that. If you find that the mouse is too sensitive or not sensitive enough you can make the equations a bit more complex. Windows, for example, simulates acceleration when it decides the mouse position.
Colin Jeanne | Invader''s Realm
I think by default there is no acceleration.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement