Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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

public Vector2Int GetPosition()

Returns

Type

Description

Vector2IntA 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}"); }}