Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

GameWindow

class in UnityEngine.Windowing

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Represents a native OS window managed by Unity's windowing system. This API is currently available only in EmbeddedLinux and QNX platforms.

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.

Public 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 its current 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.