GetPosition()
Gets the position of the window relative to the top-left corner of the screen.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Windowing
- Assembly: UnityEngine.WindowingModule
public Vector2Int GetPosition()
Returns
Type | Description |
|---|---|
| Vector2Int | A Vector2Int that represents the position of the window. |
Examples
using UnityEngine;using UnityEngine.Windowing;public class WindowPositionExample : MonoBehaviour{ void Start() { var window = GameWindow.Main; Vector2Int pos = window.GetPosition(); Debug.Log($"Window position: {pos.x}, {pos.y}"); }}