SFML community forums
Help => Window => Topic started by: Razzeeyy on January 02, 2012, 10:15:47 pm
-
Is there any way of tracking mouse almost (while it's in window bounds) permanently?
Not only when it's moved but also when it just stay in the same position.
The code like this gives weird behavior when the mouse not moved, but clicked (the coordinates just jumping, or something like that, to the opposite side for a second).
sf::Vector2f MousePosition(Event.MouseMove.X, Event.MouseMove.Y);
The_Tank.GetGun().AimAt(MousePosition);
Any ideas?
The newb(me) forehand thank you. :)
P.S. Also Is there any person interested in 2D top-down view game development? I'm trying myself at that, and would be fine to see another person who can assist me or at least give a piece of advice.
-
Event.MouseMove can only be used after you get a MouseMoved event...
Use sf::Input instead. But it won't work when the cursor is outside the window, you must upgrade to SFML 2 to get what you want.
-
Use sf::Input instead. But it won't work when the cursor is outside the window, you must upgrade to SFML 2 to get what you want.
I'm ok with that :) At least I'm all-mighty inside the window :D
Ty again for help.