Apparently, from everything I’ve seen, the simplest and most intuitive way is to put objects inside the view.
For example:
RectangleShape background (Vector2f(windowWidth, windowHeight)); // draw a full rectangle to show the container dimensions
background.setFillColor(Color::White);
RectangleShape r1 (Vector2f(100,100)); // 1st object
r1.setFillColor(Color::Red);
r1.setPosition(Vector2f(30,10));
RectangleShape r2 (Vector2f(150,200)); // 2nd object
r2.setFillColor(Color::Blue);
r2.setPosition(Vector2f(120,160));
while (window.isOpen())
{
Event event;
while (window.pollEvent(event))
{
if (event.type == Event::Closed)
window.close();
}
window.clear();
window.setView(view);
window.draw(background);
window.draw(r1);
window.draw(r2);
view.setRotation(30); // affects all elements
window.display();
}
return 0;
}