Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GameWindow

Represents a native OS window managed by Unity's windowing system. This API is currently available only in EmbeddedLinux and QNX platforms.
Read time 2 minutesLast updated 6 days ago

Definition

public class GameWindow : IEquatable<GameWindow>, IAsyncDisposable

Remarks

The GameWindow class provides APIs to query and control window properties such as title, size, position, display, and fullscreen mode. It also supports asynchronous operations for moving, resizing, and destroying windows.

Static Properties

Property

Description

MainGets the main window of the application.

Methods

Method

Description

DisposeAsyncAsynchronously disposes of the window and releases its resources.
FocusedThisFrameChecks if the window gained input focus during the current frame.
GetDisplayInfoGets the display information of the display that holds the window.
GetFullScreenModeGets the full-screen mode of the window.
GetHashCodeReturns the hash code for this window.
GetHeightGets the height of the window.
GetLogicalDpiGets the logical DPI of the window.
GetPositionGets the position of the window relative to the top-left corner of the screen.
GetResolutionGets the resolution of the window.
GetTitleGets the title of the window.
GetWidthGets the width of the window.
HiddenThisFrameChecks if the window was hidden during the current frame.
IsFocusedChecks if the window has input focus.
IsMainReturns true if this window is the main application window.
IsResizableChecks if the window can be resized manually.
IsValidReturns true if this window is valid and not destroyed.
IsVisibleChecks if the window is visible.
MoveToMoves the window to a new position on the specified display asynchronously.
PositionChangedThisFrameChecks if the window's position changed during the current frame.
RegisterDestructionCallbackRegisters a callback that is invoked when the window is destroyed.
RegisterFocusChangedCallbackRegisters a callback that is invoked when the window gains or loses input focus.
RegisterPositionChangedCallbackRegisters a callback that is invoked when the window's position changes.
RegisterResolutionChangedCallbackRegisters a callback that is invoked when the window's resolution changes.
RegisterVisibilityChangedCallbackRegisters a callback that is invoked when the window is shown or hidden.
ResolutionChangedThisFrameChecks if the window's resolution changed during the current frame.
SetFullScreenModeSets the full-screen mode of the window.
SetIsResizableSets whether the window can be resized manually.
SetIsVisibleSets whether the window is visible.
SetResolutionSets the resolution of the window.
SetTitleSets the title of the window.
ShownThisFrameChecks if the window was shown during the current frame.
UnfocusedThisFrameChecks if the window lost input focus during the current frame.
UnregisterDestructionCallbackUnregisters a callback so it is no longer invoked when the window is destroyed.
UnregisterFocusChangedCallbackUnregisters a callback so it is no longer invoked when the window's focus changes.
UnregisterPositionChangedCallbackUnregisters a callback so it is no longer invoked when the window's position changes.
UnregisterResolutionChangedCallbackUnregisters a callback so it is no longer invoked when the window's resolution changes.
UnregisterVisibilityChangedCallbackUnregisters a callback so it is no longer invoked when the window's visibility changes.