I am again struggling. I am trying to create two views. The view is suppose to be menu and the other view the playing surface. Both views are covering the same space. I am currently trying to make views shift to different areas.
Here is my main rendering code;
_render.setView(_render.getDefaultView());
_render.setView(_menu.menuView(sf::FloatRect(0, 0, 0.5, 0.5)));
texture.draw(_menu.newBoard());
sf::View current = texture.getView();
_render.setView(_render.getDefaultView());
_play.viewport(sf::FloatRect(0, 0.5, 1, 1));
_render.setView(_play._view);
texture.draw(_play.draw());
sf::View currentview = texture.getView();
//Return drawing back to main window
_render.setView(_render.getDefaultView());
texture.display();
_render.clear();
And here is my viewport function:
_view.reset(sf::FloatRect(200, 200, 300, 200));
_view.setCenter(20, 20);
_view.setSize(800,800);
_view.setViewport(dimensions);
return _view;
Thanks.