use of com.badlogic.gdx.Screen in project AmazingMaze by TheVirtualMachine.
the class MazeScreen method setupPauseMenu.
/** Create the pause menu. */
private void setupPauseMenu() {
pauseMenu = new Stage(new ScreenViewport(), game.batch);
Table table = new Table();
table.setFillParent(true);
table.center();
pauseMenu.addActor(table);
TextButton resumeButton = new TextButton("Resume", game.assets.skin);
resumeButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
paused = false;
}
});
table.add(resumeButton).pad(10).width(Gdx.graphics.getWidth() / 4).height(Gdx.graphics.getHeight() / 8);
table.row();
TextButton settingsButton = new TextButton("Settings", game.assets.skin);
final Screen sourceScreen = this;
settingsButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
game.settingsScreen.setSourceScreen(sourceScreen);
game.setScreen(game.settingsScreen);
}
});
table.add(settingsButton).pad(10).width(Gdx.graphics.getWidth() / 4).height(Gdx.graphics.getHeight() / 8);
table.row();
TextButton quitButton = new TextButton("Main Menu", game.assets.skin);
quitButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
game.setScreen(game.menuScreen);
}
});
table.add(quitButton).pad(10).width(Gdx.graphics.getWidth() / 4).height(Gdx.graphics.getHeight() / 8);
}
use of com.badlogic.gdx.Screen in project high-flyer by sangngh.
the class ScreenManager method getScreen.
public Screen getScreen(int level) {
Screen screen = screens.get(level);
if (screen == null) {
switch(level) {
case 1:
screen = new Level1(game);
screens.put(1, screen);
break;
case 2:
screen = new Level2(game);
screens.put(2, screen);
default:
break;
}
}
return screen;
}
use of com.badlogic.gdx.Screen in project high-flyer by sangngh.
the class ScreenManager method getInitial.
public Screen getInitial() {
Screen screen = new Level1(game);
screens.put(1, screen);
return screen;
}
use of com.badlogic.gdx.Screen in project high-flyer by sangngh.
the class LandingDetector method detect.
@Override
public boolean detect(GameEngine game, List<Cell> nextCells, Player player, float nextX, float nextY) {
if (isLandingCell(nextCells, nextX, nextY)) {
finishStage(game.getState());
game.getState().setLvl(2);
Screen screen = screenManager.getScreen(2);
game.setScreen(screen);
player.setX(0);
player.setY((game.getSettings().getWindowHeight() / 2) - (player.getPlayerHeight() / 2));
return true;
}
return false;
}
use of com.badlogic.gdx.Screen in project AmazingMaze by TheVirtualMachine.
the class FishMiniGame method setupPauseMenu.
/** Create the pause menu. */
private void setupPauseMenu() {
pauseMenu = new Stage(new ScreenViewport(), game.batch);
Table table = new Table();
table.setFillParent(true);
table.center();
pauseMenu.addActor(table);
TextButton resumeButton = new TextButton("Resume", game.assets.skin);
resumeButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
paused = false;
}
});
table.add(resumeButton).pad(10).width(Gdx.graphics.getWidth() / 4).height(Gdx.graphics.getHeight() / 8);
table.row();
TextButton settingsButton = new TextButton("Settings", game.assets.skin);
final Screen sourceScreen = this;
settingsButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
game.settingsScreen.setSourceScreen(sourceScreen);
game.setScreen(game.settingsScreen);
}
});
table.add(settingsButton).pad(10).width(Gdx.graphics.getWidth() / 4).height(Gdx.graphics.getHeight() / 8);
table.row();
TextButton quitButton = new TextButton("Quit", game.assets.skin);
quitButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
game.save.setLevel(game.save.getLevel() - 1);
game.setScreen(game.menuScreen);
}
});
table.add(quitButton).pad(10).width(Gdx.graphics.getWidth() / 4).height(Gdx.graphics.getHeight() / 8);
}
Aggregations