
Note! It looks way better on a phone comparing to the GIF.

Let’s set up our scene, we will add a couple of images and a button to change the orientation:

Building two separate versions of each scene is a tedious process! For this tutorial we will have Portrait as the default mode. Even though, in extreme cases you might want to create either a dedicated UI layer per orientation or even the whole scene, I personally would advise against that due to increased coding and maintenance complexity. Scene preparationīefore you even add your first element on a scene you should decide which screen orientation will be the default one. There are three parts: Scene preparation, Coding and Edge cases. It is also worth mentioning that the project was tested on Android only.Īs always, project sources are available at GitHub, find the link at the end of the page. Like in my case, Zen Jigsaw needed support for Tablets right from the start but I could never find time (till last week) to implement it. This article assumes that your game IS suitable for both orientations. In this tutorial I will show you how to add support for both screen modes, also revealing a few edge cases that you might not have thought of. Obviously, by doing that a significant share of devices is left out. Quite often developers choose to “ignore” the fact that there are two screen orientations available on the market - Portrait and Landscape, adding support for only one of them. Background Photos by Anni Roenkae from Pexels
