SFML community forums

Help => General => Topic started by: Baron Pi on January 19, 2008, 01:20:22 pm

Title: Using mousewheelmoved
Post 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?
Title: Using mousewheelmoved
Post by: Laurent on January 19, 2008, 05:01:30 pm
Use Event.MouseWheel.Delta when you receive a MouseWheelMoved event.
Title: Using mousewheelmoved
Post by: Baron Pi on January 19, 2008, 05:25:44 pm
OK great! Thanks!