SFML community forums

Help => Graphics => Topic started by: Chocolatesheep on January 08, 2012, 08:30:25 pm

Title: Sprite keeps moving to the top left corner of the window
Post by: Chocolatesheep on January 08, 2012, 08:30:25 pm
I used
Code: [Select]
Sprite.SetPosition(Event.MouseMove.X, Event.MouseMove.Y);
So basically the the sprite moves along with my mouse(because it's in a while loop). Anyway, every time i click something, like the space bar or the mouse button(anything at all) the sprite teleports to the top left corner of the window, and comes back to the mouse pointer after the button is released. How can I stop this, it's very annoying.
Title: Sprite keeps moving to the top left corner of the window
Post by: Laurent on January 08, 2012, 08:32:12 pm
You don't use Event.MouseMove when you didn't catch a sf::Event::MouseMoved event, do you?
Title: Sprite keeps moving to the top left corner of the window
Post by: Chocolatesheep on January 09, 2012, 02:57:21 am
I'm dumb :)