Hey guys, it's me again
In the SFML, there is stuff I unterstand really good.
In the SFML, there is stuff I understand a little bit.
But in the SFML, there is also stuff I really don't unterstand. And this stuff is called sf::Event...
I've got a map and sf::view. If I scroll up the mouse wheel the map should zoom in and vice versa (Sry, my English could be bad
). I tried it with:
while(window.pollEvent(event))
{
if(event.mouseWheel.delta == 1)
{
view.zoom(0.9f);
}
}
Yeah, it works!
But what unfortunately also works is if I click right mouse button and if I release right mouse button the view also zooms in.
I tried it with:
if(event.mouseWheel.delta == 1 && !sf::Mouse::isButtonPressed(sf::Mouse::Button::Right))
{
view.zoom(0.9f);
}
Now it "just" zoom in if I release the right mouse button.
But I don't want that the view zooms after right relase, only after wheel...
What I have to do?
Thanks a lot,
5gum
PS: I try your ideas only tomorrow afternoon cause I'm tired of programming today