A
A
Artem Chebotarev2016-03-09 10:37:28
Java
Artem Chebotarev, 2016-03-09 10:37:28

What is the best way to implement support for different aspect ratios in Android?

In libGDX I use an orthographic camera, I set its resolution via .getScreenWidth() and .getScreenHeight(). I scale all game objects using coefficients that I calculate from the screen resolution of the device.
But, I developed the game for a 16:9 aspect ratio, when tested on a device with a 16:10 aspect ratio, of course, all square elements turned into rectangles.
What is the best way to solve this problem?
In other libGDX projects, I have seen that the resolution of the orthographic camera is fixed and much less than the screen resolution of the device, for example, 800x450. I tried to do the same, but it turns out a terrible soap.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question