Handling multiple screen sizes with viewports

The diversity of devices users play games on is vast and overwhelming, especially when targeting different platforms including phones, tablets, and browsers. This presents a lot of challenges for developers. Hundreds of different specs, processing power, screen sizes, APIs... It is a real mess. When it comes to games, it is not only the programmers who are affected, but designers, animators, and artists are also affected. The same level may not look the same on two devices and both level layout and assets need to cater for that.

Nowadays, it is not rare at all to find a situation like the one shown in the following figure:

There is a range of strategies to tackle the varying screen resolution and different ...

Get Libgdx Cross-platform Game Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.