Screen.SetResolution 设置分辨率

Screen.SetResolution 设置分辨率

JavaScript ⇒ public static function SetResolution(width: int, height: int, fullscreen: bool): void; 
JavaScript ⇒ public static function SetResolution(width: int, height: int, fullscreen: bool, preferredRefreshRate: int = 0): void; 
C# ⇒ public static void SetResolution(int width, int height, bool fullscreen); 
C# ⇒ public static void SetResolution(int width, int height, bool fullscreen, int preferredRefreshRate = 0);

Description 描述

Switches the screen resolution.

切换屏幕分辨率。

A width by height resolution will be used. If no matching resolution is supported, the closest one will be used.

应用有宽高的分辨率,如果没有匹配的分辨率被支持,将使用最接近的分辨率。

If preferredRefreshRate is 0 (default) Unity will switch to the highest refresh rate supported by the monitor.
If preferredRefreshRate is not 0 Unity will use it if the monitor supports it, otherwise will choose the highest supported one.

如果preferredRefreshRate为0(默认),Unity将切换到显示器支持的最高刷新率。如果preferredRefreshRate不是0,如果显示器支持,Unity将使用它,否则将选择支持的最高的一个。

In the web player you may only switch resolutions after the user has clicked on the content. The recommended way of doing it is to switch resolutions only when the user clicks on a designated button.

在网络播放器,你只可以在用户点击内容之后切换分辨率。推荐的方法是只在用户点击一个指定的按钮时切换分辨率。

On Android fullscreen controls the SYSTEM_UI_FLAG_LOW_PROFILE flag to View.setSystemUiVisibility(), on devices running Honeycomb (OS 3.0 / API 11) or later.

在Android全屏是控制SYSTEM_UI_FLAG_LOW_PROFILE到View.setSystemUiVisibility(),在Android系统3.0或更高版本的设备。

On Windows Store Apps, switching to non-native resolution is only supported starting from Windows 8.1 and newer.

在Windows Store Apps切换到非本地分辨率,仅支持Windows 8.1或更高版本。

A resolution switch does not happen immediately; it will actually happen when the current frame is finished.

全屏开关不会立即发生,在当前帧完成时它才实际发生。

	// Switch to 640 x 480 fullscreen 全屏模式
	Screen.SetResolution(640, 480, true);
	// Switch to 640 x 480 fullscreen at 60 hz 
	Screen.SetResolution (640, 480, true, 60);
	// Switch to 800 x 600 windowed 窗口模式
	Screen.SetResolution (800, 600, false);

JavaScript ⇒ public static function SetResolution(width: int, height: int, fullscreen: bool): void; 
JavaScript ⇒ public static function SetResolution(width: int, height: int, fullscreen: bool, preferredRefreshRate: int = 0): void; 
C# ⇒ public static void SetResolution(int width, int height, bool fullscreen); 
C# ⇒ public static void SetResolution(int width, int height, bool fullscreen, int preferredRefreshRate = 0);

Description 描述

Switches the screen resolution.

切换屏幕分辨率。

A width by height resolution will be used. If no matching resolution is supported, the closest one will be used.

应用有宽高的分辨率,如果没有匹配的分辨率被支持,将使用最接近的分辨率。

If preferredRefreshRate is 0 (default) Unity will switch to the highest refresh rate supported by the monitor.
If preferredRefreshRate is not 0 Unity will use it if the monitor supports it, otherwise will choose the highest supported one.

如果preferredRefreshRate为0(默认),Unity将切换到显示器支持的最高刷新率。如果preferredRefreshRate不是0,如果显示器支持,Unity将使用它,否则将选择支持的最高的一个。

In the web player you may only switch resolutions after the user has clicked on the content. The recommended way of doing it is to switch resolutions only when the user clicks on a designated button.

在网络播放器,你只可以在用户点击内容之后切换分辨率。推荐的方法是只在用户点击一个指定的按钮时切换分辨率。

On Android fullscreen controls the SYSTEM_UI_FLAG_LOW_PROFILE flag to View.setSystemUiVisibility(), on devices running Honeycomb (OS 3.0 / API 11) or later.

在Android全屏是控制SYSTEM_UI_FLAG_LOW_PROFILE到View.setSystemUiVisibility(),在Android系统3.0或更高版本的设备。

On Windows Store Apps, switching to non-native resolution is only supported starting from Windows 8.1 and newer.

在Windows Store Apps切换到非本地分辨率,仅支持Windows 8.1或更高版本。

A resolution switch does not happen immediately; it will actually happen when the current frame is finished.

全屏开关不会立即发生,在当前帧完成时它才实际发生。

	// Switch to 640 x 480 fullscreen 全屏模式
	Screen.SetResolution(640, 480, true);
	// Switch to 640 x 480 fullscreen at 60 hz 
	Screen.SetResolution (640, 480, true, 60);
	// Switch to 800 x 600 windowed 窗口模式
	Screen.SetResolution (800, 600, false);
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值