Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Blaspie

Pages: [1]
1
Graphics / Re: Zoom a sf::View to Mouse-Point Center?
« on: January 28, 2015, 07:57:30 pm »
This works for me:
                        view.zoom(1 - event.mouseWheel.delta*0.1);
                        view.move(((sf::Vector2f(window.mapPixelToCoords((sf::Mouse::getPosition())) - sf::Vector2f(view.getCenter()))).x)*event.mouseWheel.delta*0.1,
                                          ((sf::Vector2f(window.mapPixelToCoords((sf::Mouse::getPosition())) - sf::Vector2f(view.getCenter()))).y)*event.mouseWheel.delta*0.1);
 

Pages: [1]