SFML community forums
Help => Graphics => Topic started by: BlackPhoenix on July 30, 2010, 09:44:46 pm
-
Hello,
The title pretty much says it all. I want to grab a small circle that I draw with the mouse, and move it. Like drag and drop.
Also I wonder why the code below doesn't work
while(Input.IsMouseButtonDown(sf::Mouse::Left))
selector.SetPosition(Input.GetMouseX(),Input.GetMouseY());
Thanks
-
while(Input.IsMouseButtonDown(sf::Mouse::Left))
selector.SetPosition(Input.GetMouseX(),Input.GetMouseY());
I'd at least change the while to an if, otherwise it won't do anything else if it's true- even render.
-
And further you could first check, if the mouse is over the circle before moving it ;)