Game Development Reference
In-Depth Information
stack.add(layerControls);
stage.addActor(layerOptionsWindow);
}
In rebuildStage() , we build everything that will make up the final scene of our
menu screen. This method is implemented in a way so that it can be called in a
repeated manner, hence the name rebuildStage . While we are implementing each
of the layers, you might want to try and modify the code in each step to get a better
understanding of how TableLayout behaves in certain situations.
Next, add the following code to the same class:
private Table buildBackgroundLayer () {
Table layer = new Table();
return layer;
}
private Table buildObjectsLayer () {
Table layer = new Table();
return layer;
}
private Table buildLogosLayer () {
Table layer = new Table();
return layer;
}
private Table buildControlsLayer () {
Table layer = new Table();
return layer;
}
private Table buildOptionsWindowLayer () {
Table layer = new Table();
return layer;
}
We have added five new methods that contain dummy implementations for now.
These will be used to build each layer of the menu.
Next, make the following changes to the same class:
@Override
public void resize (int width, int height) {
stage.getViewport().update(width, height, true);
}
@Override
public void hide () {
 
Search WWH ::




Custom Search