[英]Unity windowed mode size is different on different screen resolutions
So I want the window size in the build to be of a certain size and it works great when displayed on 1920 x 1080 screen resolution, anything more or less than that, and the window becomes too big or too small.因此,我希望构建中的 window 尺寸具有一定的尺寸,并且在以 1920 x 1080 的屏幕分辨率(或多或少)显示时效果很好,并且 window 变得太大或太小。 Is there any way for the window to be of the same window to screen size resolution?
有什么方法可以让 window 与屏幕尺寸分辨率相同 window?
I have used the following settings:我使用了以下设置:
Afaik you can set the resolution depending on the Display screen size using Screen.currentResolution
and Screen.SetResolution
somewhat like eg Afaik 您可以使用
Screen.currentResolution
和Screen.SetResolution
根据显示屏幕大小设置分辨率,有点像例如
public class ScreenSizeController : MonoBehaviour
{
// how much space (percentage) of the screen should your window fill
[Range(0f,1f)]
public float fillX;
[Range(0f,1f)]
public float fillY;
private void Awake()
{
// Get actual display resolution
var res = Screen.currentResolution;
// calculate target resolution using the fill
var targetX = fillX * res.width;
var targetY = fillY * res.height;
// Set player resolution
Screen.SetResolution(targetX, targetY, false);
}
}
Note: Typed on smartphone but I hope the idea gets clear注意:在智能手机上输入,但我希望这个想法很清楚
Wouldn't changing the screen width/height in the resolution and presentation menu to 1920 x 1080 fix it不会将分辨率和演示菜单中的屏幕宽度/高度更改为 1920 x 1080 修复它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.