Version: 2020.2
言語: 日本語

Display

class in UnityEngine

マニュアルに切り替える

説明

レンダリング処理の際、ディスプレイ / 画面へのアクセスを提供します。

マルチディスプレイレンダリングはPC (Windows/Mac/Linux)、iOS、Androidで利用できます。

ディスプレイそれ自体で操作するためには、Display クラスを使い、個々のディスプレイにレンダリングするためにカメラを設定するには、Camera.targetDisplay を使用します。

See Also: Camera.targetDisplay, Canvas.targetDisplay.

using UnityEngine;

public class Example : MonoBehaviour { Camera extCam; Camera cam;

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 = cam.depth - 1;

cam.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 変数

displaysThe list of currently connected displays.
mainメインディスプレイ

変数

activeGets the state of the display and returns true if the display is active and false if otherwise.
colorBufferカラー RenderBuffer
depthBufferデプス RenderBuffer.
renderingHeightディスプレイがレンダリングする垂直方向 (縦方向) の解像度
renderingWidthディスプレイがレンダリングする平行方向 (横方向) の解像度
requiresBlitToBackbufferTrue when the back buffer requires an intermediate texture to render.
requiresSrgbBlitToBackbufferTrue when doing a blit to the back buffer requires manual color space conversion.
systemHeight垂直方向 (縦方向) のネイティブのディスプレイ解像度
systemWidth平行方向 (横方向) のネイティブのディスプレイ解像度

Public 関数

Activate拡張ディスプレイを有効にします。例えば、システムにセカンドディスプレイが接続されているような場合です。
SetParams画面上のレンダリングのサイズと位置を設定します (Windows 専用)。
SetRenderingResolutionディスプレイのレンダリング解像度を設定します

Static 関数

RelativeMouseAt相対的マウス座標を探します。