reckfellENGINE

Window

A window viewport with its own UI and events.

On this page
class WindowReckfellSharpInherits Viewport

Window represents a main or child window. Subwindows may be embedded in the parent viewport or native, depending on backend support and project settings. AcceptDialog and ConfirmationDialog inherit Window.

For an unsaved document, handle CloseRequested and configure EntityTree.AutoAcceptQuit. Exit only after a successful save or explicit discard. Validate persisted Position/Size against the current usable screen area; embedded-window coordinates belong to the parent viewport.

Working example.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

WindowConstructor
# Window
C#
public Window();

Properties42

AccessibilityDescriptionProperty
# AccessibilityDescription
C#
public string AccessibilityDescription { get; set; }

The human-readable node description that is reported to assistive apps.

AccessibilityNameProperty
# AccessibilityName
C#
public string AccessibilityName { get; set; }

The human-readable node name that is reported to assistive apps.

AlwaysOnTopProperty
# AlwaysOnTop
C#
public bool AlwaysOnTop { get; set; }

If true, the window will be on top of all other windows. Does not work if Window.Transient is enabled.

AutoTranslateProperty · Deprecated
# AutoTranslate
C#
public bool AutoTranslate { get; set; }

Toggles if any text should automatically change to its translated version depending on the current locale.

BorderlessProperty
# Borderless
C#
public bool Borderless { get; set; }

If true, the window will have no borders.

ContentScaleAspectProperty
# ContentScaleAspect
C#
public Window.ContentScaleAspectEnum ContentScaleAspect { get; set; }

Aspect policy for content scaling. Keep preserves the base area with bars where necessary; Expand exposes additional logical area; Ignore permits nonuniform stretching. Does not automatically lay out UI controls.

ContentScaleFactorProperty
# ContentScaleFactor
C#
public float ContentScaleFactor { get; set; }

Scale factor for the whole content, not only fonts. In the tested CanvasItems case, increasing 1 to 2 halves the logical visible area on each axis. In Viewport mode it also affects internal render dimensions; validate layout and quality separately.

ContentScaleModeProperty
# ContentScaleMode
C#
public Window.ContentScaleModeEnum ContentScaleMode { get; set; }

Window content scaling mode. CanvasItems scales logical 2D while rendering at the fitted window size; Viewport renders at a base-derived resolution and then scales the image. Not the separate 3D resolution scale.

ContentScaleSizeProperty
# ContentScaleSize
C#
public Vector2I ContentScaleSize { get; set; }

Base design size for window content scaling. Does not switch monitor resolution and is not necessarily the window Size or render-target size. Final logical area depends on mode, aspect policy and ContentScaleFactor.

ContentScaleStretchProperty
# ContentScaleStretch
C#
public Window.ContentScaleStretchEnum ContentScaleStretch { get; set; }

The policy to use to determine the final scale factor for 2D elements. This affects how Window.ContentScaleFactor is applied, in addition to the automatic scale factor determined by Window.ContentScaleSize.

CurrentScreenProperty
# CurrentScreen
C#
public int CurrentScreen { get; set; }

The screen the window is currently on.

ExcludeFromCaptureProperty
# ExcludeFromCapture
C#
public bool ExcludeFromCapture { get; set; }

If true, the Window is excluded from screenshots taken by DisplayServer.ScreenGetImage, DisplayServer.ScreenGetImageRect, and DisplayServer.ScreenGetPixel. Note: This property is implemented on macOS and Windows. Note: Enabling this setting will prevent standard screenshot methods from capturing a window image, but does NOT guarantee that other apps won't be able to capture an image. It should not be used as a DRM or security measure.

ExclusiveProperty
# Exclusive
C#
public bool Exclusive { get; set; }

If true, the Window will be in exclusive mode. Exclusive windows are always on top of their parent and will block all input going to the parent Window. Needs Window.Transient enabled to work.

ExtendToTitleProperty
# ExtendToTitle
C#
public bool ExtendToTitle { get; set; }

If true, the Window contents is expanded to the full size of the window, window title bar is transparent. Note: This property is implemented only on macOS. Note: This property only works with native windows.

ForceNativeProperty
# ForceNative
C#
public bool ForceNative { get; set; }

If true, native window will be used regardless of parent viewport and project settings.

FullscreenShortcutEnabledProperty
# FullscreenShortcutEnabled
C#
public bool FullscreenShortcutEnabled { get; set; }

If true, allows the user to toggle fullscreen mode by pressing the shortcut defined in ProjectSettings.input/ui_toggle_fullscreen ([kbd]Alt + Enter[/kbd] by default). This is enabled on the main window according to the ProjectSettings.display/window/size/enable_toggle_fullscreen_shortcut project setting.

HdrOutputRequestedProperty
# HdrOutputRequested
C#
public bool HdrOutputRequested { get; set; }

If true, requests HDR output for the Window, falling back to SDR if not supported, and automatically switching between HDR and SDR as the window moves between screens, screen capabilities change, or system settings are modified. This will internally force Viewport.UseHdr2D to be enabled on the main Viewport. All other SubViewport of this Window must have their Viewport.UseHdr2D property enabled to produce HDR output.

InitialPositionProperty
# InitialPosition
C#
public Window.WindowInitialPosition InitialPosition { get; set; }

Specifies the initial type of position for the Window.

KeepTitleVisibleProperty
# KeepTitleVisible
C#
public bool KeepTitleVisible { get; set; }

If true, the Window width is expanded to keep the title bar text fully visible.

MaxSizeProperty
# MaxSize
C#
public Vector2I MaxSize { get; set; }

If non-zero, the Window can't be resized to be bigger than this size. Note: This property will be ignored if the value is lower than Window.MinSize.

MaximizeDisabledProperty
# MaximizeDisabled
C#
public bool MaximizeDisabled { get; set; }

If true, the Window's maximize button is disabled. Note: If both minimize and maximize buttons are disabled, buttons are fully hidden, and only close button is visible. Note: This property is implemented on Linux (X11), macOS, and Windows.

MinSizeProperty
# MinSize
C#
public Vector2I MinSize { get; set; }

If non-zero, the Window can't be resized to be smaller than this size. Note: This property will be ignored in favor of Window.GetContentsMinimumSize if Window.WrapControls is enabled and if its size is bigger.

MinimizeDisabledProperty
# MinimizeDisabled
C#
public bool MinimizeDisabled { get; set; }

If true, the Window's minimize button is disabled. Note: If both minimize and maximize buttons are disabled, buttons are fully hidden, and only close button is visible. Note: This property is implemented on Linux (X11), macOS, and Windows.

ModeProperty
# Mode
C#
public Window.ModeEnum Mode { get; set; }

Set's the window's current mode. Note: Fullscreen mode is not exclusive full screen on Windows and Linux. Note: This method only works with native windows, i.e. the main window and Window-derived nodes when Viewport.GuiEmbedSubwindows is disabled in the main viewport.

MousePassthroughProperty
# MousePassthrough
C#
public bool MousePassthrough { get; set; }

If true, all mouse events will be passed to the underlying window of the same application. See also Window.MousePassthroughPolygon. Note: This property is implemented on Linux (X11), macOS and Windows. Note: This property only works with native windows.

MousePassthroughPolygonProperty
# MousePassthroughPolygon
C#
public Vector2[] MousePassthroughPolygon { get; set; }

Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).

C#
// Set region, using Path2D node.
GetEntity<Window>("Window").MousePassthroughPolygon = GetEntity<Path2D>("Path2D").Curve.GetBakedPoints();

// Set region, using Polygon2D node.
GetEntity<Window>("Window").MousePassthroughPolygon = GetEntity<Polygon2D>("Polygon2D").Polygon;

// Reset region to default.
GetEntity<Window>("Window").MousePassthroughPolygon = [];

Note: This property is ignored if Window.MousePassthrough is set to true. Note: On Windows, the portion of a window that lies outside the region is not drawn, while on Linux (X11) and macOS it is. Note: This property is implemented on Linux (X11), macOS and Windows.

NonclientAreaProperty
# NonclientArea
C#
public Rect2I NonclientArea { get; set; }

If set, defines the window's custom decoration area which will receive mouse input, even if normal input to the window is blocked (such as when it has an exclusive child opened). See also Window.NonclientWindowInput.

PopupWMHintProperty
# PopupWMHint
C#
public bool PopupWMHint { get; set; }

If true, the Window will signal to the window manager that it is supposed to be an implementation-defined "popup" (usually a floating, borderless, untileable and immovable child window).

PopupWindowProperty
# PopupWindow
C#
public bool PopupWindow { get; set; }

If true, the Window will be considered a popup. Popups are sub-windows that don't show as separate windows in system's window manager's window list and will send close request when anything is clicked outside of them (unless Window.Exclusive is enabled).

PositionProperty
# Position
C#
public Vector2I Position { get; set; }

Window position in its mode's coordinate space. An embedded window uses its parent viewport; a native one uses the screen. Validate restored coordinates against the current usable area, including negative monitor coordinates.

SharpCornersProperty
# SharpCorners
C#
public bool SharpCorners { get; set; }

If true, the Window will override the OS window style to display sharp corners. Note: This property is implemented only on Windows (11). Note: This property only works with native windows.

SizeProperty
# Size
C#
public Vector2I Size { get; set; }

The window's size in pixels. See also Window.ContentScaleSize, which doesn't set the window's physical size but affects how scaling works relative to the current Window.ContentScaleMode.

ThemeProperty
# Theme
C#
public Theme Theme { get; set; }

The Theme resource this node and all its Control and Window children use. If a child node has its own Theme resource set, theme items are merged with child's definitions having higher priority. Note: Window styles will have no effect unless the window is embedded.

ThemeTypeVariationProperty
# ThemeTypeVariation
C#
public StringName ThemeTypeVariation { get; set; }

The name of a theme type variation used by this Window to look up its own theme items. See Control.ThemeTypeVariation for more details.

TitleProperty
# Title
C#
public string Title { get; set; }

The window's title. If the Window is native, title styles set in Theme will have no effect. If empty, some dialogs may use a default title.

TransientProperty
# Transient
C#
public bool Transient { get; set; }

If true, the Window is transient, i.e. it's considered a child of another Window. The transient window will be destroyed with its transient parent and will return focus to their parent when closed. The transient window is displayed on top of a non-exclusive full-screen parent window. Transient windows can't enter full-screen mode. Note that behavior might be different depending on the platform.

TransientToFocusedProperty
# TransientToFocused
C#
public bool TransientToFocused { get; set; }

If true, and the Window is Window.Transient, this window will (at the time of becoming visible) become transient to the currently focused window instead of the immediate parent window in the hierarchy. Note that the transient parent is assigned at the time this window becomes visible, so changing it afterwards has no effect until re-shown.

TransparentProperty
# Transparent
C#
public bool Transparent { get; set; }

If true, the Window's background can be transparent. This is best used with embedded windows. Note: Transparency support is implemented on Linux, macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities. Note: This property has no effect if ProjectSettings.display/window/per_pixel_transparency/allowed is set to false.

UnfocusableProperty
# Unfocusable
C#
public bool Unfocusable { get; set; }

If true, the Window can't be focused nor interacted with. It can still be visible.

UnresizableProperty
# Unresizable
C#
public bool Unresizable { get; set; }

If true, the window can't be resized.

VisibleProperty
# Visible
C#
public bool Visible { get; set; }

If true, the window is visible.

WrapControlsProperty
# WrapControls
C#
public bool WrapControls { get; set; }

If true, the window's size will automatically update when a child node is added or removed, ignoring Window.MinSize if the new size is bigger. If false, you need to call Window.ChildControlsChanged manually.

Methods142

AddThemeColorOverridevoid
# AddThemeColorOverride
C#
public void AddThemeColorOverride(StringName name, Color color);

Creates a local override for a theme Color with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Window.RemoveThemeColorOverride. See also Window.GetThemeColor and Control.AddThemeColorOverride for more details.

Parameters
NameTypeDefault
nameStringName—
colorColor—
AddThemeConstantOverridevoid
# AddThemeConstantOverride
C#
public void AddThemeConstantOverride(StringName name, int constant);

Creates a local override for a theme constant with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Window.RemoveThemeConstantOverride. See also Window.GetThemeConstant.

Parameters
NameTypeDefault
nameStringName—
constantint—
AddThemeFontOverridevoid
# AddThemeFontOverride
C#
public void AddThemeFontOverride(StringName name, Font font);

Creates a local override for a theme Font with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Window.RemoveThemeFontOverride. See also Window.GetThemeFont.

Parameters
NameTypeDefault
nameStringName—
fontFont—
AddThemeFontSizeOverridevoid
# AddThemeFontSizeOverride
C#
public void AddThemeFontSizeOverride(StringName name, int fontSize);

Creates a local override for a theme font size with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Window.RemoveThemeFontSizeOverride. See also Window.GetThemeFontSize.

Parameters
NameTypeDefault
nameStringName—
fontSizeint—
AddThemeIconOverridevoid
# AddThemeIconOverride
C#
public void AddThemeIconOverride(StringName name, Texture2D texture);

Creates a local override for a theme icon with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Window.RemoveThemeIconOverride. See also Window.GetThemeIcon.

Parameters
NameTypeDefault
nameStringName—
textureTexture2D—
AddThemeSoundOverridevoid
# AddThemeSoundOverride
C#
public void AddThemeSoundOverride(StringName name, AudioStream sound);

Creates a local override for a theme sound with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Window.RemoveThemeSoundOverride. See also Window.GetThemeSound.

Parameters
NameTypeDefault
nameStringName—
soundAudioStream—
AddThemeStyleboxOverridevoid
# AddThemeStyleboxOverride
C#
public void AddThemeStyleboxOverride(StringName name, StyleBox stylebox);

Creates a local override for a theme StyleBox with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Window.RemoveThemeStyleboxOverride. See also Window.GetThemeStylebox and Control.AddThemeStyleboxOverride for more details.

Parameters
NameTypeDefault
nameStringName—
styleboxStyleBox—
BeginBulkThemeOverridevoid
# BeginBulkThemeOverride
C#
public void BeginBulkThemeOverride();

Prevents *_theme_*_override methods from emitting Window.NotificationThemeChanged until Window.EndBulkThemeOverride is called.

CanDrawbool
# CanDraw
C#
public bool CanDraw();

Returns whether the window is being drawn to the screen.

Returns bool
ChildControlsChangedvoid
# ChildControlsChanged
C#
public void ChildControlsChanged();

Requests an update of the Window size to fit underlying Control nodes.

EndBulkThemeOverridevoid
# EndBulkThemeOverride
C#
public void EndBulkThemeOverride();

Ends a bulk theme override update. See Window.BeginBulkThemeOverride.

GetAccessibilityDescriptionstring
# GetAccessibilityDescription
C#
public string GetAccessibilityDescription();
Returns string
GetAccessibilityNamestring
# GetAccessibilityName
C#
public string GetAccessibilityName();
Returns string
GetContentScaleAspectWindow.ContentScaleAspectEnum
# GetContentScaleAspect
C#
public Window.ContentScaleAspectEnum GetContentScaleAspect();

Returns the requested ContentScaleAspect value. Aspect policy for content scaling. Keep preserves the base area with bars where necessary; Expand exposes additional logical area; Ignore permits nonuniform stretching. Does not automatically lay out UI controls.

Returns Window.ContentScaleAspectEnum

Value of ContentScaleAspect; account for the documented distinction between a setting and its effective result.

GetContentScaleFactorfloat
# GetContentScaleFactor
C#
public float GetContentScaleFactor();

Returns the requested ContentScaleFactor value. Scale factor for the whole content, not only fonts. In the tested CanvasItems case, increasing 1 to 2 halves the logical visible area on each axis. In Viewport mode it also affects internal render dimensions; validate layout and quality separately.

Returns float

Value of ContentScaleFactor; account for the documented distinction between a setting and its effective result.

GetContentScaleModeWindow.ContentScaleModeEnum
# GetContentScaleMode
C#
public Window.ContentScaleModeEnum GetContentScaleMode();

Returns the requested ContentScaleMode value. Window content scaling mode. CanvasItems scales logical 2D while rendering at the fitted window size; Viewport renders at a base-derived resolution and then scales the image. Not the separate 3D resolution scale.

Returns Window.ContentScaleModeEnum

Value of ContentScaleMode; account for the documented distinction between a setting and its effective result.

GetContentScaleSizeVector2I
# GetContentScaleSize
C#
public Vector2I GetContentScaleSize();

Returns the requested ContentScaleSize value. Base design size for window content scaling. Does not switch monitor resolution and is not necessarily the window Size or render-target size. Final logical area depends on mode, aspect policy and ContentScaleFactor.

Returns Vector2I

Value of ContentScaleSize; account for the documented distinction between a setting and its effective result.

GetContentScaleStretchWindow.ContentScaleStretchEnum
# GetContentScaleStretch
C#
public Window.ContentScaleStretchEnum GetContentScaleStretch();
Returns Window.ContentScaleStretchEnum
GetContentsMinimumSizeVector2
# GetContentsMinimumSize
C#
public Vector2 GetContentsMinimumSize();

Virtual method to be implemented by the user. Overrides the value returned by Window.GetContentsMinimumSize.

Returns Vector2
GetCurrentScreenint
# GetCurrentScreen
C#
public int GetCurrentScreen();
Returns int
GetFlagbool
# GetFlag
C#
public bool GetFlag(Window.Flags flag);

Returns true if the flag is set.

Parameters
NameTypeDefault
flagWindow.Flags—
Returns bool
GetFocusedWindowWindow
# GetFocusedWindow
C#
public static Window GetFocusedWindow();

Returns the focused window.

Returns Window
GetForceNativebool
# GetForceNative
C#
public bool GetForceNative();
Returns bool
GetInitialPositionWindow.WindowInitialPosition
# GetInitialPosition
C#
public Window.WindowInitialPosition GetInitialPosition();
Returns Window.WindowInitialPosition
GetKeepTitleVisiblebool
# GetKeepTitleVisible
C#
public bool GetKeepTitleVisible();
Returns bool
GetLayoutDirectionWindow.LayoutDirection
# GetLayoutDirection
C#
public Window.LayoutDirection GetLayoutDirection();

Returns layout direction and text writing direction.

Returns Window.LayoutDirection
GetMaxSizeVector2I
# GetMaxSize
C#
public Vector2I GetMaxSize();
Returns Vector2I
GetMinSizeVector2I
# GetMinSize
C#
public Vector2I GetMinSize();
Returns Vector2I
GetModeWindow.ModeEnum
# GetMode
C#
public Window.ModeEnum GetMode();
Returns Window.ModeEnum
GetMousePassthroughPolygonVector2[]
# GetMousePassthroughPolygon
C#
public Vector2[] GetMousePassthroughPolygon();
Returns Vector2[]
GetNonclientAreaRect2I
# GetNonclientArea
C#
public Rect2I GetNonclientArea();
Returns Rect2I
GetOutputMaxLinearValuefloat
# GetOutputMaxLinearValue
C#
public float GetOutputMaxLinearValue();

Returns the maximum value for linear color components that can be displayed in this window, regardless of SDR or HDR output. Returns 1.0 if HDR is not enabled or not supported. The Window.OutputMaxLinearValueChanged signal will be emitted whenever this value changes. This value is used by tonemapping and other Environment effects to ensure that bright colors are presented in the range that can be displayed by this window. When using this maximum linear value in your project, it should only be used to present colors directly to the screen without tonemapping and without influencing lighting, post-processing effects, or surrounding color. The following is an example that produces the brightest purple color that the screen can produce:

Note: You will need to convert sRGB colors to linear before multiplying by this value to get correct results.

Returns float
GetPositionVector2I
# GetPosition
C#
public Vector2I GetPosition();
Returns Vector2I
GetPositionWithDecorationsVector2I
# GetPositionWithDecorations
C#
public Vector2I GetPositionWithDecorations();

Returns the window's position including its border. Note: If Window.Visible is false, this method returns the same value as Window.Position.

Returns Vector2I
GetSizeVector2I
# GetSize
C#
public Vector2I GetSize();
Returns Vector2I
GetSizeWithDecorationsVector2I
# GetSizeWithDecorations
C#
public Vector2I GetSizeWithDecorations();

Returns the window's size including its border. Note: If Window.Visible is false, this method returns the same value as Window.Size.

Returns Vector2I
GetThemeTheme
# GetTheme
C#
public Theme GetTheme();
Returns Theme
GetThemeColorColor
# GetThemeColor
C#
public Color GetThemeColor(StringName name, StringName themeType = null);

Returns a Color from the first matching Theme in the tree if that Theme has a color item with the specified name and theme_type. See Control.GetThemeColor for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns Color
GetThemeConstantint
# GetThemeConstant
C#
public int GetThemeConstant(StringName name, StringName themeType = null);

Returns a constant from the first matching Theme in the tree if that Theme has a constant item with the specified name and theme_type. See Control.GetThemeColor for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns int
GetThemeDefaultBaseScalefloat
# GetThemeDefaultBaseScale
C#
public float GetThemeDefaultBaseScale();

Returns the default base scale value from the first matching Theme in the tree if that Theme has a valid Theme.DefaultBaseScale value. See Control.GetThemeColor for details.

Returns float
GetThemeDefaultFontFont
# GetThemeDefaultFont
C#
public Font GetThemeDefaultFont();

Returns the default font from the first matching Theme in the tree if that Theme has a valid Theme.DefaultFont value. See Control.GetThemeColor for details.

Returns Font
GetThemeDefaultFontSizeint
# GetThemeDefaultFontSize
C#
public int GetThemeDefaultFontSize();

Returns the default font size value from the first matching Theme in the tree if that Theme has a valid Theme.DefaultFontSize value. See Control.GetThemeColor for details.

Returns int
GetThemeFontFont
# GetThemeFont
C#
public Font GetThemeFont(StringName name, StringName themeType = null);

Returns a Font from the first matching Theme in the tree if that Theme has a font item with the specified name and theme_type. See Control.GetThemeColor for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns Font
GetThemeFontSizeint
# GetThemeFontSize
C#
public int GetThemeFontSize(StringName name, StringName themeType = null);

Returns a font size from the first matching Theme in the tree if that Theme has a font size item with the specified name and theme_type. See Control.GetThemeColor for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns int
GetThemeIconTexture2D
# GetThemeIcon
C#
public Texture2D GetThemeIcon(StringName name, StringName themeType = null);

Returns an icon from the first matching Theme in the tree if that Theme has an icon item with the specified name and theme_type. See Control.GetThemeColor for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns Texture2D
GetThemeSoundAudioStream
# GetThemeSound
C#
public AudioStream GetThemeSound(StringName name, StringName themeType = null);

Returns a sound from the first matching Theme in the tree if that Theme has a sound item with the specified name and theme_type. See Control.GetThemeColor for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns AudioStream
GetThemeStyleboxStyleBox
# GetThemeStylebox
C#
public StyleBox GetThemeStylebox(StringName name, StringName themeType = null);

Returns a StyleBox from the first matching Theme in the tree if that Theme has a stylebox item with the specified name and theme_type. See Control.GetThemeColor for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns StyleBox
GetThemeTypeVariationStringName
# GetThemeTypeVariation
C#
public StringName GetThemeTypeVariation();
Returns StringName
GetTitlestring
# GetTitle
C#
public string GetTitle();
Returns string
GetWindowIdint
# GetWindowId
C#
public int GetWindowId();

Returns the ID of the window.

Returns int
GrabFocusvoid
# GrabFocus
C#
public void GrabFocus();

Causes the window to grab focus, allowing it to receive user input.

HasFocusbool
# HasFocus
C#
public bool HasFocus();

Returns true if the window is focused.

Returns bool
HasThemeColorbool
# HasThemeColor
C#
public bool HasThemeColor(StringName name, StringName themeType = null);

Returns true if there is a matching Theme in the tree that has a color item with the specified name and theme_type. See Control.GetThemeColor for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns bool
HasThemeColorOverridebool
# HasThemeColorOverride
C#
public bool HasThemeColorOverride(StringName name);

Returns true if there is a local override for a theme Color with the specified name in this Control node. See Window.AddThemeColorOverride.

Parameters
NameTypeDefault
nameStringName—
Returns bool
HasThemeConstantbool
# HasThemeConstant
C#
public bool HasThemeConstant(StringName name, StringName themeType = null);

Returns true if there is a matching Theme in the tree that has a constant item with the specified name and theme_type. See Control.GetThemeColor for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns bool
HasThemeConstantOverridebool
# HasThemeConstantOverride
C#
public bool HasThemeConstantOverride(StringName name);

Returns true if there is a local override for a theme constant with the specified name in this Control node. See Window.AddThemeConstantOverride.

Parameters
NameTypeDefault
nameStringName—
Returns bool
HasThemeFontbool
# HasThemeFont
C#
public bool HasThemeFont(StringName name, StringName themeType = null);

Returns true if there is a matching Theme in the tree that has a font item with the specified name and theme_type. See Control.GetThemeFont for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns bool
HasThemeFontOverridebool
# HasThemeFontOverride
C#
public bool HasThemeFontOverride(StringName name);

Returns true if there is a local override for a theme Font with the specified name in this Control node. See Window.AddThemeFontOverride.

Parameters
NameTypeDefault
nameStringName—
Returns bool
HasThemeFontSizebool
# HasThemeFontSize
C#
public bool HasThemeFontSize(StringName name, StringName themeType = null);

Returns true if there is a matching Theme in the tree that has a font size item with the specified name and theme_type. See Control.GetThemeFontSize for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns bool
HasThemeFontSizeOverridebool
# HasThemeFontSizeOverride
C#
public bool HasThemeFontSizeOverride(StringName name);

Returns true if there is a local override for a theme font size with the specified name in this Control node. See Window.AddThemeFontSizeOverride.

Parameters
NameTypeDefault
nameStringName—
Returns bool
HasThemeIconbool
# HasThemeIcon
C#
public bool HasThemeIcon(StringName name, StringName themeType = null);

Returns true if there is a matching Theme in the tree that has an icon item with the specified name and theme_type. See Control.GetThemeIcon for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns bool
HasThemeIconOverridebool
# HasThemeIconOverride
C#
public bool HasThemeIconOverride(StringName name);

Returns true if there is a local override for a theme icon with the specified name in this Control node. See Window.AddThemeIconOverride.

Parameters
NameTypeDefault
nameStringName—
Returns bool
HasThemeSoundbool
# HasThemeSound
C#
public bool HasThemeSound(StringName name, StringName themeType = null);

Returns true if there is a matching Theme in the tree that has a sound item with the specified name and theme_type. See Control.GetThemeSound for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns bool
HasThemeSoundOverridebool
# HasThemeSoundOverride
C#
public bool HasThemeSoundOverride(StringName name);

Returns true if there is a local override for a theme sound with the specified name in this Control node. See Window.AddThemeSoundOverride.

Parameters
NameTypeDefault
nameStringName—
Returns bool
HasThemeStyleboxbool
# HasThemeStylebox
C#
public bool HasThemeStylebox(StringName name, StringName themeType = null);

Returns true if there is a matching Theme in the tree that has a stylebox item with the specified name and theme_type. See Control.GetThemeStylebox for details.

Parameters
NameTypeDefault
nameStringName—
themeTypeStringNamenull
Returns bool
HasThemeStyleboxOverridebool
# HasThemeStyleboxOverride
C#
public bool HasThemeStyleboxOverride(StringName name);

Returns true if there is a local override for a theme StyleBox with the specified name in this Control node. See Window.AddThemeStyleboxOverride.

Parameters
NameTypeDefault
nameStringName—
Returns bool
Hidevoid
# Hide
C#
public void Hide();

Hides the window. This is not the same as minimized state. Hidden window can't be interacted with and needs to be made visible with Window.Show.

IsAutoTranslatingbool
# IsAutoTranslating
C#
public bool IsAutoTranslating();
Returns bool
IsEmbeddedbool
# IsEmbedded
C#
public bool IsEmbedded();

Returns true if the window is currently embedded in another window.

Returns bool
IsExclusivebool
# IsExclusive
C#
public bool IsExclusive();
Returns bool
IsFullscreenShortcutEnabledbool
# IsFullscreenShortcutEnabled
C#
public bool IsFullscreenShortcutEnabled();
Returns bool
IsHdrOutputRequestedbool
# IsHdrOutputRequested
C#
public bool IsHdrOutputRequested();
Returns bool
IsLayoutRtlbool
# IsLayoutRtl
C#
public bool IsLayoutRtl();

Returns true if the layout is right-to-left.

Returns bool
IsMaximizeAllowedbool
# IsMaximizeAllowed
C#
public bool IsMaximizeAllowed();

Returns true if the window can be maximized (the maximize button is enabled).

Returns bool
IsTransientbool
# IsTransient
C#
public bool IsTransient();
Returns bool
IsTransientToFocusedbool
# IsTransientToFocused
C#
public bool IsTransientToFocused();
Returns bool
IsUsingFontOversamplingbool
# IsUsingFontOversampling
C#
public bool IsUsingFontOversampling();

Returns true if font oversampling is enabled. See Window.SetUseFontOversampling.

Returns bool
IsVisiblebool
# IsVisible
C#
public bool IsVisible();
Returns bool
IsWrappingControlsbool
# IsWrappingControls
C#
public bool IsWrappingControls();
Returns bool
MoveToCentervoid
# MoveToCenter
C#
public void MoveToCenter();

Centers the window in the current screen. If the window is embedded, it is centered in the embedder Viewport instead.

MoveToForegroundvoid · Deprecated
# MoveToForeground
C#
public void MoveToForeground();

Causes the window to grab focus, allowing it to receive user input.

Popupvoid
# Popup
C#
public void Popup(Rect2I? rect = default);

Shows the Window and makes it transient (see Window.Transient). If rect is provided, it will be set as the Window's size. Fails if called on the main window. If ProjectSettings.display/window/subwindows/embed_subwindows is true (single-window mode), rect's coordinates are global and relative to the main window's top-left corner (excluding window decorations). If rect's position coordinates are negative, the window will be located outside the main window and may not be visible as a result. If ProjectSettings.display/window/subwindows/embed_subwindows is false (multi-window mode), rect's coordinates are global and relative to the top-left corner of the leftmost screen. If rect's position coordinates are negative, the window will be placed at the top-left corner of the screen. Note: rect must be in global coordinates if specified.

Parameters
NameTypeDefault
rectRect2I?default
rect

If the parameter is null, then the default value is new Rect2I(new Vector2I(0, 0), new Vector2I(0, 0)).

PopupCenteredvoid
# PopupCentered
C#
public void PopupCentered(Vector2I? minsize = default);

Popups the Window at the center of the current screen, with optionally given minimum size. If the Window is embedded, it will be centered in the parent Viewport instead. Note: Calling it with the default value of minsize is equivalent to calling it with Window.Size.

Parameters
NameTypeDefault
minsizeVector2I?default
minsize

If the parameter is null, then the default value is new Vector2I(0, 0).

PopupCenteredClampedvoid
# PopupCenteredClamped
C#
public void PopupCenteredClamped(Vector2I? minsize = default, float fallbackRatio = 0.75f);

Popups the Window centered inside its parent Window. fallback_ratio determines the maximum size of the Window, in relation to its parent. Note: Calling it with the default value of minsize is equivalent to calling it with Window.Size.

Parameters
NameTypeDefault
minsizeVector2I?default
fallbackRatiofloat0.75f
minsize

If the parameter is null, then the default value is new Vector2I(0, 0).

PopupCenteredRatiovoid
# PopupCenteredRatio
C#
public void PopupCenteredRatio(float ratio = 0.8f);

If Window is embedded, popups the Window centered inside its embedder and sets its size as a ratio of embedder's size. If Window is a native window, popups the Window centered inside the screen of its parent Window and sets its size as a ratio of the screen size.

Parameters
NameTypeDefault
ratiofloat0.8f
PopupExclusivevoid
# PopupExclusive
C#
public void PopupExclusive(Entity fromNode, Rect2I? rect = default);

Attempts to parent this dialog to the last exclusive window relative to from_node, and then calls Window.Popup on it. The dialog must have no current parent, otherwise the method fails. See also Window.SetUnparentWhenInvisible and Entity.GetLastExclusiveWindow.

Parameters
NameTypeDefault
fromNodeEntity—
rectRect2I?default
rect

If the parameter is null, then the default value is new Rect2I(new Vector2I(0, 0), new Vector2I(0, 0)).

PopupExclusiveCenteredvoid
# PopupExclusiveCentered
C#
public void PopupExclusiveCentered(Entity fromNode, Vector2I? minsize = default);

Attempts to parent this dialog to the last exclusive window relative to from_node, and then calls Window.PopupCentered on it. The dialog must have no current parent, otherwise the method fails. See also Window.SetUnparentWhenInvisible and Entity.GetLastExclusiveWindow.

Parameters
NameTypeDefault
fromNodeEntity—
minsizeVector2I?default
minsize

If the parameter is null, then the default value is new Vector2I(0, 0).

PopupExclusiveCenteredClampedvoid
# PopupExclusiveCenteredClamped
C#
public void PopupExclusiveCenteredClamped(Entity fromNode, Vector2I? minsize = default, float fallbackRatio = 0.75f);

Attempts to parent this dialog to the last exclusive window relative to from_node, and then calls Window.PopupCenteredClamped on it. The dialog must have no current parent, otherwise the method fails. See also Window.SetUnparentWhenInvisible and Entity.GetLastExclusiveWindow.

Parameters
NameTypeDefault
fromNodeEntity—
minsizeVector2I?default
fallbackRatiofloat0.75f
minsize

If the parameter is null, then the default value is new Vector2I(0, 0).

PopupExclusiveCenteredRatiovoid
# PopupExclusiveCenteredRatio
C#
public void PopupExclusiveCenteredRatio(Entity fromNode, float ratio = 0.8f);

Attempts to parent this dialog to the last exclusive window relative to from_node, and then calls Window.PopupCenteredRatio on it. The dialog must have no current parent, otherwise the method fails. See also Window.SetUnparentWhenInvisible and Entity.GetLastExclusiveWindow.

Parameters
NameTypeDefault
fromNodeEntity—
ratiofloat0.8f
PopupExclusiveOnParentvoid
# PopupExclusiveOnParent
C#
public void PopupExclusiveOnParent(Entity fromNode, Rect2I parentRect);

Attempts to parent this dialog to the last exclusive window relative to from_node, and then calls Window.PopupOnParent on it. The dialog must have no current parent, otherwise the method fails. See also Window.SetUnparentWhenInvisible and Entity.GetLastExclusiveWindow.

Parameters
NameTypeDefault
fromNodeEntity—
parentRectRect2I—
PopupOnParentvoid
# PopupOnParent
C#
public void PopupOnParent(Rect2I parentRect);

Popups the Window with a position shifted by parent Window's position. If the Window is embedded, has the same effect as Window.Popup.

Parameters
NameTypeDefault
parentRectRect2I—
RemoveThemeColorOverridevoid
# RemoveThemeColorOverride
C#
public void RemoveThemeColorOverride(StringName name);

Removes a local override for a theme Color with the specified name previously added by Window.AddThemeColorOverride or via the Inspector dock.

Parameters
NameTypeDefault
nameStringName—
RemoveThemeConstantOverridevoid
# RemoveThemeConstantOverride
C#
public void RemoveThemeConstantOverride(StringName name);

Removes a local override for a theme constant with the specified name previously added by Window.AddThemeConstantOverride or via the Inspector dock.

Parameters
NameTypeDefault
nameStringName—
RemoveThemeFontOverridevoid
# RemoveThemeFontOverride
C#
public void RemoveThemeFontOverride(StringName name);

Removes a local override for a theme Font with the specified name previously added by Window.AddThemeFontOverride or via the Inspector dock.

Parameters
NameTypeDefault
nameStringName—
RemoveThemeFontSizeOverridevoid
# RemoveThemeFontSizeOverride
C#
public void RemoveThemeFontSizeOverride(StringName name);

Removes a local override for a theme font size with the specified name previously added by Window.AddThemeFontSizeOverride or via the Inspector dock.

Parameters
NameTypeDefault
nameStringName—
RemoveThemeIconOverridevoid
# RemoveThemeIconOverride
C#
public void RemoveThemeIconOverride(StringName name);

Removes a local override for a theme icon with the specified name previously added by Window.AddThemeIconOverride or via the Inspector dock.

Parameters
NameTypeDefault
nameStringName—
RemoveThemeSoundOverridevoid
# RemoveThemeSoundOverride
C#
public void RemoveThemeSoundOverride(StringName name);

Removes a local override for a theme sound with the specified name previously added by Window.AddThemeSoundOverride or via the Inspector dock.

Parameters
NameTypeDefault
nameStringName—
RemoveThemeStyleboxOverridevoid
# RemoveThemeStyleboxOverride
C#
public void RemoveThemeStyleboxOverride(StringName name);

Removes a local override for a theme StyleBox with the specified name previously added by Window.AddThemeStyleboxOverride or via the Inspector dock.

Parameters
NameTypeDefault
nameStringName—
RequestAttentionvoid
# RequestAttention
C#
public void RequestAttention();

Tells the OS that the Window needs an attention. This makes the window stand out in some way depending on the system, e.g. it might blink on the task bar.

ResetSizevoid
# ResetSize
C#
public void ResetSize();

Resets the size to the minimum size, which is the max of Window.MinSize and (if Window.WrapControls is enabled) Window.GetContentsMinimumSize. This is equivalent to calling set_size(Vector2i()) (or any size below the minimum).

SetAccessibilityDescriptionvoid
# SetAccessibilityDescription
C#
public void SetAccessibilityDescription(string description);
Parameters
NameTypeDefault
descriptionstring—
SetAccessibilityNamevoid
# SetAccessibilityName
C#
public void SetAccessibilityName(string name);
Parameters
NameTypeDefault
namestring—
SetAutoTranslatevoid
# SetAutoTranslate
C#
public void SetAutoTranslate(bool enable);
Parameters
NameTypeDefault
enablebool—
SetContentScaleAspectvoid
# SetContentScaleAspect
C#
public void SetContentScaleAspect(Window.ContentScaleAspectEnum aspect);

Sets ContentScaleAspect. Aspect policy for content scaling. Keep preserves the base area with bars where necessary; Expand exposes additional logical area; Ignore permits nonuniform stretching. Does not automatically lay out UI controls.

Parameters
NameTypeDefault
aspectWindow.ContentScaleAspectEnum—
aspect

Aspect policy for content scaling. Keep preserves the base area with bars where necessary; Expand exposes additional logical area; Ignore permits nonuniform stretching. Does not automatically lay out UI controls.

SetContentScaleFactorvoid
# SetContentScaleFactor
C#
public void SetContentScaleFactor(float factor);

Sets ContentScaleFactor. Scale factor for the whole content, not only fonts. In the tested CanvasItems case, increasing 1 to 2 halves the logical visible area on each axis. In Viewport mode it also affects internal render dimensions; validate layout and quality separately.

Parameters
NameTypeDefault
factorfloat—
factor

Scale factor for the whole content, not only fonts. In the tested CanvasItems case, increasing 1 to 2 halves the logical visible area on each axis. In Viewport mode it also affects internal render dimensions; validate layout and quality separately.

SetContentScaleModevoid
# SetContentScaleMode
C#
public void SetContentScaleMode(Window.ContentScaleModeEnum mode);

Sets ContentScaleMode. Window content scaling mode. CanvasItems scales logical 2D while rendering at the fitted window size; Viewport renders at a base-derived resolution and then scales the image. Not the separate 3D resolution scale.

Parameters
NameTypeDefault
modeWindow.ContentScaleModeEnum—
mode

Window content scaling mode. CanvasItems scales logical 2D while rendering at the fitted window size; Viewport renders at a base-derived resolution and then scales the image. Not the separate 3D resolution scale.

SetContentScaleSizevoid
# SetContentScaleSize
C#
public void SetContentScaleSize(Vector2I size);

Sets ContentScaleSize. Base design size for window content scaling. Does not switch monitor resolution and is not necessarily the window Size or render-target size. Final logical area depends on mode, aspect policy and ContentScaleFactor.

Parameters
NameTypeDefault
sizeVector2I—
size

Base design size for window content scaling. Does not switch monitor resolution and is not necessarily the window Size or render-target size. Final logical area depends on mode, aspect policy and ContentScaleFactor.

SetContentScaleStretchvoid
# SetContentScaleStretch
C#
public void SetContentScaleStretch(Window.ContentScaleStretchEnum stretch);
Parameters
NameTypeDefault
stretchWindow.ContentScaleStretchEnum—
SetCurrentScreenvoid
# SetCurrentScreen
C#
public void SetCurrentScreen(int index);
Parameters
NameTypeDefault
indexint—
SetExclusivevoid
# SetExclusive
C#
public void SetExclusive(bool exclusive);
Parameters
NameTypeDefault
exclusivebool—
SetFlagvoid
# SetFlag
C#
public void SetFlag(Window.Flags flag, bool enabled);

Sets a specified window flag.

Parameters
NameTypeDefault
flagWindow.Flags—
enabledbool—
SetForceNativevoid
# SetForceNative
C#
public void SetForceNative(bool forceNative);
Parameters
NameTypeDefault
forceNativebool—
SetFullscreenShortcutEnabledvoid
# SetFullscreenShortcutEnabled
C#
public void SetFullscreenShortcutEnabled(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetHdrOutputRequestedvoid
# SetHdrOutputRequested
C#
public void SetHdrOutputRequested(bool requested);
Parameters
NameTypeDefault
requestedbool—
SetImeActivevoid
# SetImeActive
C#
public void SetImeActive(bool active);

If active is true, enables system's native IME (Input Method Editor).

Parameters
NameTypeDefault
activebool—
SetImePositionvoid
# SetImePosition
C#
public void SetImePosition(Vector2I position);

Moves IME to the given position.

Parameters
NameTypeDefault
positionVector2I—
SetInitialPositionvoid
# SetInitialPosition
C#
public void SetInitialPosition(Window.WindowInitialPosition initialPosition);
Parameters
NameTypeDefault
initialPositionWindow.WindowInitialPosition—
SetKeepTitleVisiblevoid
# SetKeepTitleVisible
C#
public void SetKeepTitleVisible(bool titleVisible);
Parameters
NameTypeDefault
titleVisiblebool—
SetLayoutDirectionvoid
# SetLayoutDirection
C#
public void SetLayoutDirection(Window.LayoutDirection direction);

Sets layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew).

Parameters
NameTypeDefault
directionWindow.LayoutDirection—
SetMaxSizevoid
# SetMaxSize
C#
public void SetMaxSize(Vector2I maxSize);
Parameters
NameTypeDefault
maxSizeVector2I—
SetMinSizevoid
# SetMinSize
C#
public void SetMinSize(Vector2I minSize);
Parameters
NameTypeDefault
minSizeVector2I—
SetModevoid
# SetMode
C#
public void SetMode(Window.ModeEnum mode);
Parameters
NameTypeDefault
modeWindow.ModeEnum—
SetMousePassthroughPolygon2 overloads
# SetMousePassthroughPolygon · 1/2
C#
public void SetMousePassthroughPolygon(Vector2[] polygon);
Parameters
NameTypeDefault
polygonVector2[]—
# SetMousePassthroughPolygon · 2/2
C#
public void SetMousePassthroughPolygon(ReadOnlySpan<Vector2> polygon);
Parameters
NameTypeDefault
polygonReadOnlySpan<Vector2>—
SetNonclientAreavoid
# SetNonclientArea
C#
public void SetNonclientArea(Rect2I area);
Parameters
NameTypeDefault
areaRect2I—
SetPositionvoid
# SetPosition
C#
public void SetPosition(Vector2I position);
Parameters
NameTypeDefault
positionVector2I—
SetSizevoid
# SetSize
C#
public void SetSize(Vector2I size);
Parameters
NameTypeDefault
sizeVector2I—
SetTaskbarProgressStatevoid
# SetTaskbarProgressState
C#
public void SetTaskbarProgressState(DisplayServer.ProgressState state);

Sets the type and state of the progress bar on the taskbar/dock icon of the Window. See DisplayServer.ProgressState for possible values and how each mode behaves. Note: This method is implemented only on Windows and macOS.

Parameters
NameTypeDefault
stateDisplayServer.ProgressState—
SetTaskbarProgressValuevoid
# SetTaskbarProgressValue
C#
public void SetTaskbarProgressValue(float value);

Creates a progress bar on the taskbar/dock icon of the Window if it does not exist, sets the progress of the icon. value acts as a relative percentage value, ranges from 0.0 (lowest) to 1.0 (highest). Note: This method is implemented only on Windows and macOS.

Parameters
NameTypeDefault
valuefloat—
SetThemevoid
# SetTheme
C#
public void SetTheme(Theme theme);
Parameters
NameTypeDefault
themeTheme—
SetThemeTypeVariationvoid
# SetThemeTypeVariation
C#
public void SetThemeTypeVariation(StringName themeType);
Parameters
NameTypeDefault
themeTypeStringName—
SetTitlevoid
# SetTitle
C#
public void SetTitle(string title);
Parameters
NameTypeDefault
titlestring—
SetTransientvoid
# SetTransient
C#
public void SetTransient(bool transient);
Parameters
NameTypeDefault
transientbool—
SetTransientToFocusedvoid
# SetTransientToFocused
C#
public void SetTransientToFocused(bool enable);
Parameters
NameTypeDefault
enablebool—
SetUnparentWhenInvisiblevoid
# SetUnparentWhenInvisible
C#
public void SetUnparentWhenInvisible(bool unparent);

If unparent is true, the window is automatically unparented when going invisible. Note: Make sure to keep a reference to the node, otherwise it will be orphaned. You also need to manually call Entity.QueueFree to free the window if it's not parented.

Parameters
NameTypeDefault
unparentbool—
SetUseFontOversamplingvoid
# SetUseFontOversampling
C#
public void SetUseFontOversampling(bool enable);

Enables font oversampling. This makes fonts look better when they are scaled up.

Parameters
NameTypeDefault
enablebool—
SetVisiblevoid
# SetVisible
C#
public void SetVisible(bool visible);
Parameters
NameTypeDefault
visiblebool—
SetWrapControlsvoid
# SetWrapControls
C#
public void SetWrapControls(bool enable);
Parameters
NameTypeDefault
enablebool—
Showvoid
# Show
C#
public void Show();

Makes the Window appear. This enables interactions with the Window and doesn't change any of its property other than visibility (unlike e.g. Window.Popup).

StartDragvoid
# StartDrag
C#
public void StartDrag();

Starts an interactive drag operation on the window, using the current mouse position. Call this method when handling a mouse button being pressed to simulate a pressed event on the window's title bar. Using this method allows the window to participate in space switching, tiling, and other system features.

StartResizevoid
# StartResize
C#
public void StartResize(DisplayServer.WindowResizeEdge edge);

Starts an interactive resize operation on the window, using the current mouse position. Call this method when handling a mouse button being pressed to simulate a pressed event on the window's edge.

Parameters
NameTypeDefault
edgeDisplayServer.WindowResizeEdge—
_GetContentsMinimumSizeVector2
# _GetContentsMinimumSize
C#
public virtual Vector2 _GetContentsMinimumSize();

Virtual method to be implemented by the user. Overrides the value returned by Window.GetContentsMinimumSize.

Returns Vector2

Signals and events16

AboutToPopupEvent
# AboutToPopup
C#
public event Action AboutToPopup;

Emitted right after Window.Popup call, before the Window appears or does anything.

CloseRequestedEvent
# CloseRequested
C#
public event Action CloseRequested;

A window close request. Account for EntityTree.AutoAcceptQuit on the main window. Resolve unsaved changes and check the save result before exiting; a write error must not end the process.

DpiChangedEvent
# DpiChanged
C#
public event Action DpiChanged;

Emitted when the Window's DPI changes as a result of OS-level changes (e.g. moving the window from a Retina display to a lower resolution one). Note: Only implemented on macOS and Linux (Wayland).

FilesDroppedEvent
# FilesDropped
C#
public event Window.FilesDroppedEventHandler FilesDropped;

Emitted when files are dragged from the OS file manager and dropped in the game window. The argument is a list of file paths.

Note: This signal only works with native windows, i.e. the main window and Window-derived nodes when Viewport.GuiEmbedSubwindows is disabled in the main viewport. Note: On the web platform, the files are dropped to a temporary folder and will be removed automatically after the signal is emitted. Process them immediately, or move them to a separate possibly persistent location (e.g. user://) to preserve them.

Handler parameters
NameTypeDefault
filesstring[]—
FocusEnteredEvent
# FocusEntered
C#
public event Action FocusEntered;

Emitted when the Window gains focus.

FocusExitedEvent
# FocusExited
C#
public event Action FocusExited;

Emitted when the Window loses its focus.

GoBackRequestedEvent
# GoBackRequested
C#
public event Action GoBackRequested;

Emitted when a go back request is sent (e.g. pressing the "Back" button on Android), right after Entity.NotificationWMGoBackRequest.

MouseEnteredEvent
# MouseEntered
C#
public event Action MouseEntered;

Emitted when the mouse cursor enters the Window's visible area, that is not occluded behind other Controls or windows, provided its Viewport.GuiDisableInput is false and regardless if it's currently focused or not.

MouseExitedEvent
# MouseExited
C#
public event Action MouseExited;

Emitted when the mouse cursor leaves the Window's visible area, that is not occluded behind other Controls or windows, provided its Viewport.GuiDisableInput is false and regardless if it's currently focused or not.

NonclientWindowInputEvent
# NonclientWindowInput
C#
public event Window.NonclientWindowInputEventHandler NonclientWindowInput;

Emitted when the mouse event is received by the custom decoration area defined by Window.NonclientArea, and normal input to the window is blocked (such as when it has an exclusive child opened). event's position is in the embedder's coordinate system.

Handler parameters
NameTypeDefault
eventInputEvent—
OutputMaxLinearValueChangedEvent
# OutputMaxLinearValueChanged
C#
public event Window.OutputMaxLinearValueChangedEventHandler OutputMaxLinearValueChanged;

Emitted when the output max linear value returned by Window.GetOutputMaxLinearValue has changed. This occurs when HDR output is enabled or disabled and when any HDR output luminance values of the window have changed, such as when the player adjusts their screen brightness setting or moves the window to a different screen. output_max_linear_value is the new value.

Handler parameters
NameTypeDefault
outputMaxLinearValuedouble—
ThemeChangedEvent
# ThemeChanged
C#
public event Action ThemeChanged;

Emitted when the Window.NotificationThemeChanged notification is sent.

TitleChangedEvent
# TitleChanged
C#
public event Action TitleChanged;

Emitted when window title bar text is changed.

TitlebarChangedEvent
# TitlebarChanged
C#
public event Action TitlebarChanged;

Emitted when window title bar decorations are changed, e.g. macOS window enter/exit full screen mode, or extend-to-title flag is changed.

VisibilityChangedEvent
# VisibilityChanged
C#
public event Action VisibilityChanged;

Emitted when Window is made visible or disappears.

WindowInputEvent
# WindowInput
C#
public event Window.WindowInputEventHandler WindowInput;

Emitted when the Window is currently focused and receives any input, passing the received event as an argument. The event's position, if present, is in the embedder's coordinate system.

Handler parameters
NameTypeDefault
eventInputEvent—

Fields and constants2

NotificationThemeChangedField
# NotificationThemeChanged
C#
public const long NotificationThemeChanged = 32;

Sent when the node needs to refresh its theme items. This happens in one of the following cases:

  • The Window.Theme property is changed on this node or any of its ancestors.
  • The Window.ThemeTypeVariation property is changed on this node.
  • The node enters the scene tree. Note: As an optimization, this notification won't be sent from changes that occur while this node is outside of the scene tree. Instead, all of the theme item updates can be applied at once when the node enters the scene tree.
NotificationVisibilityChangedField
# NotificationVisibilityChanged
C#
public const long NotificationVisibilityChanged = 30;

Emitted when Window's visibility changes, right before Window.VisibilityChanged.

Window.ContentScaleAspectEnum

ValueDescription
Expand = 4

The content's aspect will be preserved. If the target size has different aspect from the base one, the content will stay in the top-left corner and add an extra visible area in the stretched space.

Ignore = 0

The aspect will be ignored. Scaling will simply stretch the content to fit the target size.

Keep = 1

The content's aspect will be preserved. If the target size has different aspect from the base one, the image will be centered and black bars will appear on left and right sides.

KeepHeight = 3

The content can be expanded horizontally. Scaling vertically will result in keeping the height ratio and then black bars on top and bottom sides.

KeepWidth = 2

The content can be expanded vertically. Scaling horizontally will result in keeping the width ratio and then black bars on left and right sides.

Window.ContentScaleModeEnum

ValueDescription
CanvasItems = 1

The content will be rendered at the target size. This is more performance-expensive than Window.ContentScaleModeEnum.Viewport, but provides better results.

Disabled = 0

The content will not be scaled to match the Window's size (Window.ContentScaleSize is ignored).

Viewport = 2

The content will be rendered at the base size and then scaled to the target size. More performant than Window.ContentScaleModeEnum.CanvasItems, but results in pixelated image.

Window.ContentScaleStretchEnum

ValueDescription
Fractional = 0

The content will be stretched according to a fractional factor. This fills all the space available in the window, but allows "pixel wobble" to occur due to uneven pixel scaling.

Integer = 1

The content will be stretched only according to an integer factor, preserving sharp pixels. This may leave a black background visible on the window's edges depending on the window size.

Window.Flags

ValueDescription
AlwaysOnTop = 2

The window is floating on top of all other windows. This flag is ignored for full-screen windows. Set with Window.AlwaysOnTop. Note: This flag is implemented on Linux (X11), macOS, Windows, and embedded windows.

Borderless = 1

The window do not have native title bar and other decorations. This flag is ignored for full-screen windows. Set with Window.Borderless. Note: This flag is implemented on Linux (X11/Wayland), macOS, Windows, and embedded windows.

ExcludeFromCapture = 9

Windows is excluded from screenshots taken by DisplayServer.ScreenGetImage, DisplayServer.ScreenGetImageRect, and DisplayServer.ScreenGetPixel. Note: This flag has no effect in embedded windows. Note: This flag is implemented on macOS and Windows (10, 20H1). Note: Setting this flag will prevent standard screenshot methods from capturing a window image, but does NOT guarantee that other apps won't be able to capture an image. It should not be used as a DRM or security measure.

ExtendToTitle = 6

Window content is expanded to the full size of the window. Unlike borderless window, the frame is left intact and can be used to resize the window, title bar is transparent, but have minimize/maximize/close buttons. Set with Window.ExtendToTitle. Note: This flag has no effect in embedded windows. Note: This flag is implemented only on macOS.

Max = 13

Max value of the Window.Flags.

MaximizeDisabled = 12

Window maximize button is disabled. Note: This flag has no effect in embedded windows. Note: This flag is implemented on Linux (X11), macOS, and Windows.

MinimizeDisabled = 11

Window minimize button is disabled. Note: This flag has no effect in embedded windows. Note: This flag is implemented on Linux (X11), macOS, and Windows.

MousePassthrough = 7

All mouse events are passed to the underlying window of the same application. Note: This flag has no effect in embedded windows. Note: This flag is implemented on Linux (X11), macOS, Windows.

NoFocus = 4

The window can't be focused. No-focus window will ignore all input, except mouse clicks. Set with Window.Unfocusable. Note: This flag is implemented on Linux (X11), macOS, Windows, and embedded windows.

Popup = 5

Window is part of menu or OptionButton dropdown. This flag can't be changed when the window is visible. An active popup window will exclusively receive all input, without stealing focus from its parent. Popup windows are automatically closed when uses click outside it, or when an application is switched. Popup window must have transient parent set (see Window.Transient). Note: This flag is implemented on Linux (X11/Wayland), macOS, Windows, and embedded Popup windows.

PopupWMHint = 10

Signals the window manager that this window is supposed to be an implementation-defined "popup" (usually a floating, borderless, untileable and immovable child window). Note: This flag has no effect in embedded windows. Note: This flag is implemented on Linux (Wayland).

ResizeDisabled = 0

The window can't be resized by dragging its resize grip. It's still possible to resize the window using Window.Size. This flag is ignored for full screen windows. Set with Window.Unresizable. Note: This flag is implemented on Linux (X11), macOS, Windows, and embedded windows.

SharpCorners = 8

Window style is overridden, forcing sharp corners. Note: This flag has no effect in embedded windows. Note: This flag is implemented only on Windows (11).

Transparent = 3

The window background can be transparent. Set with Window.Transparent. Note: This flag has no effect if either ProjectSettings.display/window/per_pixel_transparency/allowed, or the window's Viewport.TransparentBg is set to false. Note: Transparency support is implemented on Linux (X11/Wayland), macOS, Windows, and embedded windows.

Window.LayoutDirection

ValueDescription
ApplicationLocale = 1

Automatic layout direction, determined from the current locale.

Inherited = 0

Automatic layout direction, determined from the parent window layout direction.

Locale = 1
Ltr = 2

Left-to-right layout direction.

Max = 5

Represents the size of the Window.LayoutDirection enum.

Rtl = 3

Right-to-left layout direction.

SystemLocale = 4

Automatic layout direction, determined from the system locale.

Window.ModeEnum

ValueDescription
ExclusiveFullscreen = 4

A single window full screen mode. This mode has less overhead, but only one window can be open on a given screen at a time (opening a child window or application switching will trigger a full screen transition). Full screen window covers the entire display area of a screen and has no border or decorations. The display's video mode is not changed. Note: This mode might not work with screen recording software. On Android: This enables immersive mode. On Windows: Depending on video driver, full screen transition might cause screens to go black for a moment. On macOS: A new desktop is used to display the running project. Exclusive full screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen. On Linux (X11): Exclusive full screen mode bypasses compositor. On Linux (Wayland): Equivalent to Window.ModeEnum.Fullscreen. Note: Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports multiple resolutions when enabling full screen mode.

Fullscreen = 3

Full screen mode with full multi-window support. Full screen window covers the entire display area of a screen and has no decorations. The display's video mode is not changed. On Android: This enables immersive mode. On macOS: A new desktop is used to display the running project. Note: Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports multiple resolutions when enabling full screen mode.

Maximized = 2

Maximized window mode, i.e. Window will occupy whole screen area except task bar and still display its borders. Normally happens when the maximize button is pressed.

Minimized = 1

Minimized window mode, i.e. Window is not visible and available on window manager's window list. Normally happens when the minimize button is pressed.

Windowed = 0

Windowed mode, i.e. Window doesn't occupy the whole screen (unless set to the size of the screen).

Window.WindowInitialPosition

ValueDescription
Absolute = 0

Initial window position is determined by Window.Position.

CenterMainWindowScreen = 2

Initial window position is the center of the main window screen.

CenterOtherScreen = 3

Initial window position is the center of Window.CurrentScreen screen.

CenterPrimaryScreen = 1

Initial window position is the center of the primary screen.

CenterScreenWithKeyboardFocus = 5

Initial window position is the center of the screen containing the window with the keyboard focus.

CenterScreenWithMouseFocus = 4

Initial window position is the center of the screen containing the mouse pointer.

Theme properties

These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.

Key and typeDescription
title_color
Color

The color of the title's text.

Default: Color(0.875, 0.875, 0.875, 1)
title_outline_modulate
Color

The color of the title's text outline.

Default: Color(0, 0, 0, 1)
close_h_offset
int

Horizontal position offset of the close button, relative to the end of the title bar, towards the beginning of the title bar.

Default: 18
close_v_offset
int

Vertical position offset of the close button, relative to the bottom of the title bar, towards the top of the title bar.

Default: 24
resize_margin
int

Defines the outside margin at which the window border can be grabbed with mouse and resized.

Default: 4
title_height
int

Height of the title bar.

Default: 36
title_outline_size
int

The size of the title outline.

Default: 0
title_font
Font

The font used to draw the title.

title_font_size
int

The size of the title font.

close
Texture2D

The icon for the close button.

close_pressed
Texture2D

The icon for the close button when it's being pressed.

embedded_border
StyleBox

The background style used when the Window is embedded. Note that this is drawn only under the window's content, excluding the title. For proper borders and title bar style, you can use expand_margin_* properties of StyleBoxFlat. Note: The content background will not be visible unless Window.Transparent is enabled.

embedded_unfocused_border
StyleBox

The background style used when the Window is embedded and unfocused.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.