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

Author Topic: Issue with globalBounds() of text on view.zoom()  (Read 1441 times)

0 Members and 1 Guest are viewing this topic.

bryce910

  • Newbie
  • *
  • Posts: 31
    • View Profile
Issue with globalBounds() of text on view.zoom()
« 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.
« Last Edit: November 18, 2015, 08:39:43 pm by bryce910 »

bryce910

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Issue with globalBounds() of text on view.zoom()
« Reply #1 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