Il y a que comme ça que j'ai la bonne dimensions (281/800) car avec (280/800) j'ai 107x38 pour le deuxième carré.
int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "Test lib");
window.setFramerateLimit(50);
sf::RectangleShape rect1(sf::Vector2f(108, 38));
rect1.setPosition(sf::Vector2f(220, 75));
sf::RectangleShape rect2(sf::Vector2f(108, 38));
rect2.setPosition(sf::Vector2f(338, 75));
sf::RectangleShape rect3(sf::Vector2f(108, 38));
rect3.setPosition(sf::Vector2f(220, 120));
// Scrolling
sf::View view(sf::FloatRect(210, 73, 280, 469));
view.setViewport(sf::FloatRect((float)210/800, (float)73/600, (float)281/800, (float)469/600));
while(window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if(event.type == sf::Event::Closed)
window.close();
}
window.clear(sf::Color::Black);
window.setView(view);
window.draw(rect1);
window.draw(rect2);
window.draw(rect3);
window.display();
}
return 0;
}