GetLogicalDpi()
Gets the logical DPI of the window.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: UnityEngine.Windowing
- Assembly: UnityEngine.WindowingModule
public float GetLogicalDpi()
Returns
Type | Description |
|---|---|
| float | The logical DPI as a float. |
Remarks
Note that the logical DPI defaults to 0 if it's not supported by the platform.
Examples
using UnityEngine;using UnityEngine.Windowing;public class LogicalDpiExample : MonoBehaviour{ void Start() { var window = GameWindow.Main; float dpi = window.GetLogicalDpi(); Debug.Log($"Logical DPI: {dpi}"); }}