I would do it with Scene2d. You can have your game with a normal game loop and a SpriteBatch to manually update and draw the game and additionally you can have a Scene2d Stage that you can use to display whatever UI components you wish above your game (or below, depends on the order of calling the draw methods). It's a very nice library, great I would say, and it's relatively easy to pick up and start doing stuff. Also there are a lot of books and articles about it. Simplified it looks like this in code.
class MyGame extends Game {
public SpriteBatch batch;
public Stage stage;
public void create() {
batch = new SpriteBatch(.....); // construct depending on your needs
stage = new Stage(.....); // construct depending on your needs
}
public void render() {
myGame.update(delta);
stage.act(delta);
batch.begin();
renderTheGame(batch);
batch.end();
stage.draw();
}
}
The described situation is not blocking for your game - Stage does not block anything - both your game and your UI by the Stage are updated and drawn every frame. But if you want to block in case of a UI Dialog popping-up by the Stage, you can easily make an empty Game State (where the update,render method just don't do anything) and you can be in that state until the user closes the Dialog.
The benefits of using Scene2d is that it's super fast, relatively easy and it gives you a lot of things like animate the UI, skinning, 9patches, group transformations. Even if you want to write this functionality by yourself, I would recommend to look at the source of the Scene2D framework/classes, as they are very clean and well-written pieces of code.
setScreen(lockpickingScreen)
, and then when done callsetScreen(gameplayScreen)
without having to save and load any data. Just keep the screens as variables in the Game class. \$\endgroup\$