How to deal with different aspect ratios in libGDX?

How to do it nowadays:

Since this is one of the most famous questions on libgdx here, I’ll give it a little update:

LibGDX v1.0 introduced Viewport to handle this problem. It is a lot easier to use and the scaling strategy is pluggable, which means a single line can change the behaviour and you can play with it and see which one fits your game the best.

Everything you need to know about it can be found here.

Leave a Comment