Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetDisplayInfo()

Gets the display information of the display that holds the window.
Read time 1 minuteLast updated 11 days ago

Definition

public DisplayInfo GetDisplayInfo()

Returns

Type

Description

DisplayInfoA DisplayInfo object with the display details.

Examples

using UnityEngine;using UnityEngine.Windowing;public class DisplayInfoExample : MonoBehaviour{ void Start() { var window = GameWindow.Main; DisplayInfo info = window.GetDisplayInfo(); Debug.Log($"Display: {info.name}, Resolution: {info.width}x{info.height}"); }}