class in UnityEngine
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; }
colorBuffer | Color RenderBuffer. 颜色缓冲。 |
depthBuffer | Depth RenderBuffer. 深度缓冲。 |
renderingHeight | Rendering Height. 渲染高度。 |
renderingWidth | Rendering Width. 渲染宽度。 |
systemHeight | System Height. 系统高度。 |
systemWidth | System Width. 系统宽度。 |
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. 设置显示器的渲染像素。 |
RelativeMouseAt | Query relative mouse coordinates. 查询相对的鼠标位置坐标。 |