Version: 2022.3
言語: 日本語

Display

class in UnityEngine

マニュアルに切り替える

説明

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

Unity supports multi-display rendering on: Desktop platforms (Windows, macOS X, and Linux) Android (OpenGL ES and Vulkan) iOS Some features in the Display class only work on some of the supported platforms. See the properties and methods for more information about platform compatibility.

ディスプレイそれ自体で操作するためには、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 変数

activeEditorGameViewTargetGet the Editors active GameView display target.
displaysThe list of 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ディスプレイがレンダリングする垂直方向 (縦方向) の解像度
renderingWidthHorizontal resolution that the display is rendering at in the viewport.
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 関数

ActivateActivates an external display. For example, a secondary monitor connected to the system.
SetParamsWindows platforms only. Sets rendering size and position on screen.
SetRenderingResolutionディスプレイのレンダリング解像度を設定します

Static 関数

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