SFML community forums

Help => Graphics => Topic started by: TheGuerilla on May 06, 2016, 08:24:17 pm

Title: How do views work?
Post by: TheGuerilla on May 06, 2016, 08:24:17 pm
I don't quite understand how they work. I assumed originally that I could just define a view width/height/port width/height and have it display that portion of the game world, but it appears otherwise. Say I want to draw the player to the all the 4 views, because for the purpose of this example this is a 4 player split screen game. When I render the player do I have to do something like
for (int i = 0; i < views.size(); i++) {
    window.setView(views[i]);
    window.draw(playerSprite);
to draw it to all views, or can I just draw it to the default one? The documentation is fairly confusing with this issue.

Thanks
Title: AW: How do views work?
Post by: eXpl0it3r on May 06, 2016, 09:16:49 pm
Did you read the tutorial on views?
Title: Re: How do views work?
Post by: TheGuerilla on May 06, 2016, 10:33:30 pm
I did not, nor did I realize there was one. I will read it right now, thanks!