How to deal with different aspect ratios in libGDX?

后端 未结 7 2214
粉色の甜心
粉色の甜心 2020-11-29 16:16

I have implemented some screens using libGDX that would obviously use the Screen class provided by the libGDX framework. However, the implementation for these s

7条回答
  •  一个人的身影
    2020-11-29 16:55

    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.

提交回复
热议问题