SFML community forums
Help => General => Topic started by: Baron Pi on January 19, 2008, 01:20:22 pm
-
I don't know how to determine in what direction the mouse wheel moved, i.e. "up" or "down". I am trying to accomplish a simple zoom function using views. I have the following statement:
if(Event.Type == sf::Event::MouseWheelMoved)
{
//i.e. zoom in
View.Zoom += 10*App.GetFrameTime();
}
else if(Event.Type == sf::Event::MouseWheelMoved)
{
//i.e. zoom out
View.Zoom -= 10*App.GetFrameTime();
}
but I would also need something saying in what direction the mouse wheel moved. . . Any suggestions?
-
Use Event.MouseWheel.Delta when you receive a MouseWheelMoved event.
-
OK great! Thanks!