title: LibGDX - How to center an Isometric Tiled Map on screen?
body: <p>I've been tinkering around with LibGDX for a few days now. I've managed to render an Isometric Tiled Map onto the screen but I just can't seem to figure out how to center it properly. Here's the code:</p>
  
  <pre><code>public class PlayScreen implements Screen {
  
      private TiledMap map;
      private IsometricTiledMapRenderer isometricRenderer;
      private OrthographicCamera camera;
  
      public void createUI() {
          // Load map from tiled .tmx file.
          map = new TmxMapLoader().load("arena1/arena1.tmx");
  
          // Setup isometric renderer and camera.
          isometricRenderer = new IsometricTiledMapRenderer(map);
          camera = new OrthographicCamera();
      }
  
      @Override
      public void show() {
          Gdx.gl.glClearColor(0, 0, 1, 1);
          createUI();
      }
  
      @Override
      public void render(float delta) {
          Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
          isometricRenderer.setView(camera);
          isometricRenderer.render();
      }
  
      @Override
      public void resize(int width, int height) {
          camera.viewportWidth = width;
          camera.viewportHeight = height;
          camera.update();
      }
  
      @Override
      public void pause() {}
  
      @Override
      public void resume() {}
  
      @Override
      public void hide() {}
  
      @Override
      public void dispose() {
          map.dispose();
          isometricRenderer.dispose();
      }
  
  }
  </code></pre>
  
  <p>And here is what I get:</p>
  
  <p><a href="https://i.stack.imgur.com/7Z4Fy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Z4Fy.png" alt="enter image description here"></a></p>
  
  <p>Thank you in advance!</p>