I am trying to add a minimap to my game. I already used views for moving cameras, but I can't figure out how to use viewports. I know what they are supposed to do, but I still can't figure it out.
Here is what I was trying to do. I have "view" which is what I'm using for the game and "minimap" which should be the minimap.
view.setViewport(sf::FloatRect(0,0,1,1));
sf::View minimap;
minimap.reset(sf::FloatRect(0,0,level.x*56,level.y*56));
minimap.setViewport(sf::FloatRect(0.75f, 0, 0.25f, 0.25f));
They are working separately, if I bind one of them to my window ( window.setView(view); ) it works, but I can't figure out how to display them both. I searched on google but I couldn't find anything usefull.
If you can help me, leave a reply below.