SFML community forums
Help => Graphics => Topic started by: vro on August 06, 2011, 08:53:01 pm
-
Is it better to have a separate sf::view for a menu, and move between it and the game view when the player presses the pause button or whatever.
Or do you just keep the default view as the only view and then draw whatever is needed? Like this (pseudo code)?
if (game_paused)
{
app.draw(menu);
updateGame = false;
}
or this?
if (game_paused)
{
App.SetView(menu); // some view located at a different x, y
}
-
Don't draw objects that are not supposed to be displayed.
First choice.
-
I'd keep separate views(it can make your game scrolling code, and menu code simpler). But as said, only draw the ones that you need in a given frame.