code: private void updateWorldSize(final int screenWidth, final int screenHeight) {
          final float width = screenWidth * scaleX;
          final float height = screenHeight * scaleY;
          final float fitHeight = width / aspectRatio;
          if (fitHeight > height) {
              setWorldSize(height * aspectRatio, height);
          } else {
              setWorldSize(width, fitHeight);
          }
      }
docs: Forces update of current world size according to window size. Will try to keep the set aspect ratio.
  
  @param screenWidth current screen width.
  @param screenHeight current screen height.