unity 中文API之Display

Display 显示

unity 中文API之Display

Display

class in UnityEngine

Description 描述

Provides access to a display / screen for rendering operations.

提供显示器或者屏幕渲染操作的接口。

This feature is available for iPhone.

此功能可用于iPhone。

JavaScript:

void Start()
{
// GUI is rendered with last camera.
// As we want it to end up in the main screen, make sure main camera is the last one drawn.
extCam.depth = camera.depth - 1;

camera.SetTargetBuffers(Display.main.colorBuffer, Display.main.depthBuffer);
extCam.enabled = false;
}

void Update()
{
if(Display.displays.Length > 1 && !extCam.enabled)
{
Display.displays[1].SetRenderingResolution(256,256);
extCam.SetTargetBuffers(Display.displays[1].colorBuffer, Display.displays[1].depthBuffer);
}
extCam.enabled = Display.displays.Length > 1;
}

C#:

void Start()
{
// GUI is rendered with last camera.
// As we want it to end up in the main screen, make sure main camera is the last one drawn.
extCam.depth = camera.depth - 1;

camera.SetTargetBuffers(Display.main.colorBuffer, Display.main.depthBuffer);
extCam.enabled = false;
}

void Update()
{
if(Display.displays.Length > 1 && !extCam.enabled)
{
Display.displays[1].SetRenderingResolution(256,256);
extCam.SetTargetBuffers(Display.displays[1].colorBuffer, Display.displays[1].depthBuffer);
}
extCam.enabled = Display.displays.Length > 1;
}

Static Variables 静态变量

displays The list of currently connected Displays. Contains at least one (main) display.

当前连接的显示器的列表。至少包含一个主显示器。 main Main Display.

主显示器。

Variables 变量

colorBuffer Color RenderBuffer.

颜色缓冲。 depthBuffer Depth RenderBuffer.

深度缓冲。 renderingHeight Rendering Height.

渲染高度。 renderingWidth Rendering Width.

渲染宽度。 systemHeight System Height.

系统高度。 systemWidth System Width.

系统宽度。

Public Functions 公共函数

Activate Activate an external display. Eg. Secondary Monitors connected to the System.

激活外部显示。如:二级监控系统连接到该系统。 SetParams This Windows only function can be used to set Size and Position of the Screen when Multi-Display is enabled.

当Multi-Display启用时,该函数仅windows可用设置屏幕大小和位置。 SetRenderingResolution Sets Rendering resolution for the display.

设置显示器的渲染像素。

Static Functions 静态函数

RelativeMouseAt Query relative mouse coordinates.

查询相对的鼠标位置坐标。


分享到:


相關文章: