Why Does My Unity Game Not Display At Full Size On Some Devices?

对着背影说爱祢 提交于 2019-12-25 09:24:17

问题


Could someone check why my game screen does not maximize on some devices?

Look at the screenshot :

You see the black background and some UI buttons which should be hidden are appearing? The game background is not maximized on some devices.

I am using 1280 x 720 Resolution. I have set a Pivot and Anchor Point In the Rect Transform. But it seems some devices don't display it well.

What should I do to have it maximized on all device? Any ideas?

Thanks

Dennis


回答1:


I guess you are using UGUI (Unity's built-in GUI system).

Looks like the resulting screen does not match the aspect ratio you used for the UI, so it just rescales evenly until it fits the screen horizontally.

As you can see from the image below, You can have your UI elements scale to fit the screen following different criteria.

Rect Transform Anchors Presets:

If you want your UI to perfectly fit the screen and you don't mind some vertical stretch you might just use the bottom-right option.

However, it's always better to keep in mind the "safe areas" when you design your UI. It's a concept related to TV screens, but I find it extremely useful for mobile products as well, you can get more info here




回答2:


You should check if your canvas scaling is maybe set to 0.5 width and 0.5 heigth. you should change it to 0.0 width and 1.0 heigth. Also make sure your anchors is right. For the ui part i would write a manager which disables and shows ui based on game states. hope it helps xD



来源:https://stackoverflow.com/questions/42624101/why-does-my-unity-game-not-display-at-full-size-on-some-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!