title: Make 2 viewports depending on each other - libgdx
body: <p>I have a rather easy question I think.</p>
  
  <p>I am having 2 FitViewports, if I resize my game, both Viewports are resized.
  This is working out great:</p>
  
  <ol>
  <li><p><a href="https://gyazo.com/d9d011c83bbb4dd3259ebe28d5f4ac57" rel="nofollow noreferrer">When I resize my window (smaller).</a></p></li>
  <li><p><a href="https://gyazo.com/a16f9581190e0f1dd833c08e080ddfcf" rel="nofollow noreferrer">But this happens when im resizing it to be bigger.</a></p></li>
  </ol>
  
  <p>As you can see the white background is the right size, the square in the middle is also- but I want it to be just as wide as the white background.</p>
  
  <pre><code>@Override
  public void resize(int width, int height) {
      backViewport.update(width, height); //white background
      gameViewport.update(width, height); //square
  
  }
  </code></pre>
  
  <p>I want the program to do so:</p>
  
  <pre><code>@Override
  public void resize(int width, int height) {
      backViewport.update(width, height); //white background
      gameViewport.update(backViewport.getWidth(), backViewport.getWidth());
  
  }
  </code></pre>
  
  <p>Getting the new background width-size and setting my gameViewport to the same.
  I will do both width- and height- .getWidth(), because I want it to be square.</p>
  
  <p>This is not working because it is stretching my square in the y-axis.</p>
  
  <p>Thanks for your time and hopefully somebody knows a solution.</p>
  
  <p>EDIT: By doing this,</p>
  
  <pre><code>gameViewport.setScreenSize(backViewport.getScreenWidth(), backViewport.getScreenWidth());
  </code></pre>
  
  <p>I achieved to get the square the right size, but I still cant figure out, how to move it back to the center of the background.</p>