sf::Vector2f top;
top = sf::Vector2f(0,tools->ReturnView().getSize().y*.65);
if(players[0].ReturnSprite().getPosition().y <= top.y)
players[0].StopMovement(true);
Let me revise, I want to convert players coordinates to the screen coordinates (like mouse::getPosition())
For example my screen is 1200, and I want to not 65% of the screen to be off limits to the player.
top.y is = 540 which is right , but the players coordinates at the same place is equal to abou -290
I've been using this function to keep aspect ratio when changing resolution.
window.create(sf::VideoMode(resX,resY),"asdasda",sf::Style::Fullscreen);
int newH = (width*resY)/resX;
int displace = (newH - height)/(-2);
v1 = sf::View(sf::FloatRect(0,displace,width,newH));
v1.setCenter(width/2,height/2);
window.setView(v1);
height = resY;
width = resX;