Example usage for com.badlogic.gdx.utils.viewport FillViewport FillViewport

List of usage examples for com.badlogic.gdx.utils.viewport FillViewport FillViewport

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils.viewport FillViewport FillViewport.

Prototype

public FillViewport(float worldWidth, float worldHeight) 

Source Link

Document

Creates a new viewport using a new OrthographicCamera .

Usage

From source file:com.maplescot.loggerbill.ui.PausedDialog.java

License:Creative Commons License

public PausedDialog(final LoggerEngine engine) {
    billSkin = Assets.getInstance().skin;
    //stage = new Stage();
    this.engine = engine;
    stage = new Stage(new FillViewport(Constants.VIEWPORT_GUI_WIDTH, Constants.getViewportHeight())) {
        public boolean keyDown(int keyCode) {
            Gdx.app.log(TAG, "BACK");
            if (keyCode == Input.Keys.BACK || keyCode == Input.Keys.ESCAPE) {
                Gdx.input.setInputProcessor(engine.getInputProcessor());
                if (engine.isAlive())
                    engine.setPause(false);
                else
                    engine.endGame();/* www. j  av  a 2s .  c o m*/
            } else if (keyCode == Input.Keys.ENTER) {
                resumeGame();
            }

            return false;
        }
    };
}

From source file:de.bitbrain.craft.screens.IngameScreen.java

License:Open Source License

@Override
protected Viewport createViewport() {
    return new FillViewport(Sizes.worldWidth(), Sizes.worldHeight());
}

From source file:com.maplescot.loggerbill.ui.MainMenu.java

License:Creative Commons License

@Override
public void show() {
    stage = new Stage(new FillViewport(Constants.VIEWPORT_GUI_WIDTH, Constants.getViewportHeight()));
    Gdx.input.setInputProcessor(stage);//from   w  ww.j a v  a 2 s  .  c  o  m
    Gdx.input.setCatchBackKey(true);

    Ads.getInstance().showBanner(false);
    BackgroundScenery.getInstance().init();
    BackgroundScenery.getInstance().setNight(false); // Never night on the main menu.

    // dispose of used screens if we have them
    if (gameScreen != null) {
        //            gameScreen.dispose();
        gameScreen = null;
    }
    if (Assets.getInstance().splashScreen != null) {
        //            Assets.getInstance().splashScreen.dispose();
        Assets.getInstance().splashScreen = null;
    }
    rebuildStage();
}