Search in sources :

Example 1 with Screen

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);
}
Also used : TextButton(com.badlogic.gdx.scenes.scene2d.ui.TextButton) Table(com.badlogic.gdx.scenes.scene2d.ui.Table) Screen(com.badlogic.gdx.Screen) Actor(com.badlogic.gdx.scenes.scene2d.Actor) Stage(com.badlogic.gdx.scenes.scene2d.Stage) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener) ScreenViewport(com.badlogic.gdx.utils.viewport.ScreenViewport)

Example 2 with Screen

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;
}
Also used : Screen(com.badlogic.gdx.Screen)

Example 3 with 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;
}
Also used : Screen(com.badlogic.gdx.Screen)

Example 4 with 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;
}
Also used : Screen(com.badlogic.gdx.Screen)

Example 5 with Screen

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);
}
Also used : TextButton(com.badlogic.gdx.scenes.scene2d.ui.TextButton) Table(com.badlogic.gdx.scenes.scene2d.ui.Table) Screen(com.badlogic.gdx.Screen) Actor(com.badlogic.gdx.scenes.scene2d.Actor) Stage(com.badlogic.gdx.scenes.scene2d.Stage) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener) ScreenViewport(com.badlogic.gdx.utils.viewport.ScreenViewport)

Aggregations

Screen (com.badlogic.gdx.Screen)7 Actor (com.badlogic.gdx.scenes.scene2d.Actor)2 Stage (com.badlogic.gdx.scenes.scene2d.Stage)2 Table (com.badlogic.gdx.scenes.scene2d.ui.Table)2 TextButton (com.badlogic.gdx.scenes.scene2d.ui.TextButton)2 ChangeListener (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)2 ScreenViewport (com.badlogic.gdx.utils.viewport.ScreenViewport)2 BaseScreen (de.gg.screen.BaseScreen)1 BaseUIScreen (de.gg.screen.BaseUIScreen)1 GameInHouseScreen (de.gg.screen.GameInHouseScreen)1 GameLoadingScreen (de.gg.screen.GameLoadingScreen)1 GameMapScreen (de.gg.screen.GameMapScreen)1 GameRoundendScreen (de.gg.screen.GameRoundendScreen)1 LoadingScreen (de.gg.screen.LoadingScreen)1 LobbyCreationScreen (de.gg.screen.LobbyCreationScreen)1 LobbyScreen (de.gg.screen.LobbyScreen)1 MainMenuScreen (de.gg.screen.MainMenuScreen)1 ServerBrowserScreen (de.gg.screen.ServerBrowserScreen)1 SplashScreen (de.gg.screen.SplashScreen)1 MapScreen (eidolons.libgdx.screens.map.MapScreen)1