SFML community forums

Help => Window => Topic started by: bryce910 on November 18, 2015, 07:27:57 pm

Title: Issue with globalBounds() of text on view.zoom()
Post by: bryce910 on November 18, 2015, 07:27:57 pm
Hey guys!

I am currently building a small little application but I am wanting to introduce some of the zooming of the screen as part of the game play. The issue is when I view.zoom() everything zooms correctly EXCEPT I am not able to register my hover effect on text. I have to have the mouse below and to the right of the text to get the hover event.

Here is the code I am using:


textItem.getGlobalBounds().contains(sf::Mouse::getPosition(app).x, sf::Mouse::getPosition(app).y))
{

hover();

}
 

works I don't have the zoom view attached and active to the current window.
Title: Re: Issue with globalBounds() of text on view.zoom()
Post by: bryce910 on November 18, 2015, 08:42:43 pm
We can close this. I found at the bottom of documentation there is the solve for my issue:

http://www.sfml-dev.org/tutorials/2.0/graphics-view.php