Search code examples
libgdx

Is it worth having a resize method in a LibGDX mobile application?


From what I have read, the resize method in LibGDX is meant to resize the viewport and center the camera if the window is resized. Since a mobile application cannot be resized, is it worth including it?


Solution

  • Yes required even in mobile application too.

    1. If your app is for both landscape and portrait mode then you need do your stuff like changing layout of your UI in resize() method.

    2. resize() method of ApplicationListener is called after create(). Your viewport need to be scaled according to your device screen width/height and also what's the choice of your viewport.