Here's an example to simplify (?) things:
2 views, one for a background with a big face, one for a foreground with a small face. The small face will be drawn so part of it is outside of the viewport, showing where the view cuts off. Here's the result:
(http://i.imgur.com/bRoEe4i.png)
#include <SFML/Graphics.hpp>
int main(){
sf::RenderWindow window; //Declare window
window.create(sf::VideoMode(640, 480), "Viewport Example"); //Make window
sf::View vMain; //Declare main viewport
vMain.setViewport(sf::FloatRect(0, 0, 1, 1)); //Set main viewport
vMain.setCenter(320, 240);
sf::View vFace; //Declare other viewport
vFace.setViewport(sf::FloatRect(0, 0, 0.5, 0.5)); //Set face viewport, different place on screen
vFace.setSize(640*0.5, 480*0.5);
vFace.setCenter(320*0.5, 240*0.5);
sf::Texture texFace; //Declare texture
texFace.loadFromFile("face.png"); //Load texture
sf::Sprite spFaceBig; //Declare big face
spFaceBig.setTexture(texFace); //Set big face's texture
spFaceBig.setScale(10.f, 10.f); //Make big face live up to name
spFaceBig.setPosition(-320, -320); //Set big face to a nice position
spFaceBig.setColor(sf::Color::Cyan); //Change big face's colour a little
sf::Sprite spFace; //Declare face
spFace.setTexture(texFace); //Set face's texture
spFace.setPosition(240, 170); //Set face so some of it leaves the viewport
bool running=true;
while(running){
sf::Event event; //Event junk for ending loop
while(window.pollEvent(event)){
if(event.type == sf::Event::Closed){
running=false;
}
}
window.clear(); //Clear window
window.setView(vMain); //Switch active viewport
window.draw(spFaceBig); //Draw big face on active viewport
window.setView(vFace); //Switch active viewport
window.draw(spFace); //Draw face on active viewport
window.display(); //Show the screen
}
window.close();
return 0;
}
Aaand here's the face if you wanna play around with that at all
(http://i.imgur.com/PplJrOA.png)