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 ) ; } }
Forces update of current world size according to window size . Will try to keep the set aspect ratio .