GetDisplayInfo()
Gets the display information of the display that holds the window.
Read time 1 minuteLast updated 11 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Windowing
- Assembly: UnityEngine.WindowingModule
public DisplayInfo GetDisplayInfo()
Returns
Type | Description |
|---|---|
| DisplayInfo | A 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}"); }}