为什么我的Unity游戏在某些设备上无法全尺寸显示? [英] Why Does My Unity Game Not Display At Full Size On Some Devices?

查看:518
本文介绍了为什么我的Unity游戏在某些设备上无法全尺寸显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以检查为什么我的游戏屏幕无法在某些设备上最大化吗?

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

看截图:

您看到黑色背景,并且出现了一些应该隐藏的UI按钮?在某些设备上,游戏背景无法最大化.

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

我正在使用1280 x 720分辨率.我已经在Rect变换中设置了枢轴点和锚点.但是似乎有些设备不能很好地显示它.

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?

谢谢

丹尼斯

推荐答案

我猜您正在使用UGUI(Unity的内置GUI系统).

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

看起来最终的屏幕与您用于UI的宽高比不匹配,因此它只是均匀地缩放,直到适合屏幕水平为止.

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.

如下面的图片所示,您可以按照不同的条件缩放UI元素以适合屏幕.

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

Rect转换锚点预设

Rect Transform Anchors Presets:

如果您希望UI完全适合屏幕并且不介意垂直拉伸,则可以使用右下角的选项.

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.

但是,在设计UI时始终牢记安全区域"总是更好的选择. 这是一个与电视屏幕有关的概念,但我发现它对于移动产品也非常有用,您可以获得更多信息.

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

这篇关于为什么我的Unity游戏在某些设备上无法全尺寸显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆