1
General / SFML 2.0 sf::Mouse::GetPosition() returning wierd coords.
« on: November 23, 2011, 10:01:46 pm »
Well Don't I feel stupid!
If you don't feed the GetPosition() a RenderWindow it gives you coords relative to your overall window position and not the applications position.
If you don't feed the GetPosition() a RenderWindow it gives you coords relative to your overall window position and not the applications position.
Code: [Select]
sf::Event currentEvent;
while(m_GameWindow.PollEvent(currentEvent))
{
if(currentEvent.Type == sf::Event::MouseButtonPressed)
{
sf::Vector2i mouse_pos = sf::Mouse::GetPosition(sf::RenderWindow);
bool clicked = TravelBoard.CheckForTilesClicked(mouse_pos);
std::cout<<clicked<<std::endl;
}
}