Ejemplo n.º 1
0
  public GameScreen(MainWindow game, String levelName, boolean activateLights) {
    this.game = game;

    this.levelName = levelName;

    showGameOverScreen = false;

    this.activateLights = activateLights;

    Gdx.app.setLogLevel(Application.LOG_DEBUG);

    debugRenderer = new Box2DDebugRenderer();

    worldLoader = new WorldLoader(game, this);

    camera = new Cameras(game, worldLoader, game.getBatch());

    multiplexer = new InputMultiplexer();

    multiplexer.addProcessor(camera.getHudStage());
    multiplexer.addProcessor(worldLoader.getControls());

    Gdx.input.setInputProcessor(multiplexer);

    gameMiddleground = null;

    chooseBackground();
  }
Ejemplo n.º 2
0
 @Override
 public void resize(int width, int height) {
   // camera.getPlayerCamera().setToOrtho(false, (Gdx.graphics.getWidth() / Gdx.graphics.getPpiX())
   // * 2, (Gdx.graphics.getHeight() / Gdx.graphics.getPpiY() )* 2 );
   // camera.getBackgroundCamera().setToOrtho(false, (Gdx.graphics.getWidth() /
   // Gdx.graphics.getPpiX()) * 2, (Gdx.graphics.getHeight() / Gdx.graphics.getPpiY())* 2 );
   // camera.getMiddlegroundCamera().setToOrtho(false, (Gdx.graphics.getWidth() /
   // Gdx.graphics.getPpiX()) , (Gdx.graphics.getHeight() / Gdx.graphics.getPpiY()) );
   camera.getHudStage().getViewport().update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
   camera
       .getGameOverStage()
       .getViewport()
       .update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
 }