How to export my Unity game for any Android device and not have screen cut off?

I am currently taking the Unity 2d course on Udemy and I’m in the Choose your own Adv. game. I’ve set my canvas to 1920x1080 resolution and my game window is at 1920x1080 resolution. I’m exporting for Android and my resolution in the export settings is 1920x1080.

I would like to know how I can develop a game that works on Android phones without having any of the screen cut off?

Currently, the bottom of my game screen is being cut off, outside of the viewable area… I’m exporting with landscape option as the other way is far too small. Please help

1 Like

Good question… I am also nervous about exporting my games to other resolutions >_<

Hi Rick,

Welcome to our community! :slight_smile:

For this game, there is a simple solution: anchors.
https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/UIBasicLayout.html

The CanvasScaler might also be interesting for you:
https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/script-CanvasScaler.html


See also:

Is there a certain resolution that I can use to target every android device?

I’ll definitely be utilizing the anchoring of UI controls from now on.

There isn’t because Android does not have a predefined resolution. The resolution and aspect ratio depend on the device.

I found this in the unity docs. Does this return a different safe area depending on the device that is running the app/game?

https://docs.unity3d.com/ScriptReference/Screen-safeArea.html

I don’t know. I’m not an Android developer. The best would be to test that with two different devices to see what you get. Have you already logged Screen.safeArea into your console? If the values are the same as Screen.width and Screen.height, you probably don’t need to use that unless you generate the GUI during runtime. In that case, you would refer to the edges of the Screen.

I think the issue might occur if you do not use anchors to place objects relative to the edge but use the centre of the screen with a large offset. In that case, the elements could get cropped or are not visible if the target screen is too small.

This topic was automatically closed after 22 hours. New replies are no longer allowed.

Privacy & Terms