Window
A window viewport with its own UI and events.
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.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
WindowConstructor
public Window();Properties42
AccessibilityDescriptionProperty
public string AccessibilityDescription { get; set; }The human-readable node description that is reported to assistive apps.
AccessibilityNameProperty
public string AccessibilityName { get; set; }The human-readable node name that is reported to assistive apps.
AlwaysOnTopProperty
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
public bool AutoTranslate { get; set; }Toggles if any text should automatically change to its translated version depending on the current locale.
BorderlessProperty
public bool Borderless { get; set; }If true, the window will have no borders.
ContentScaleAspectProperty
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
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
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
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
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
public int CurrentScreen { get; set; }The screen the window is currently on.
ExcludeFromCaptureProperty
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
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
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
public bool ForceNative { get; set; }If true, native window will be used regardless of parent viewport and project settings.
FullscreenShortcutEnabledProperty
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
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
public Window.WindowInitialPosition InitialPosition { get; set; }Specifies the initial type of position for the Window.
KeepTitleVisibleProperty
public bool KeepTitleVisible { get; set; }If true, the Window width is expanded to keep the title bar text fully visible.
MaxSizeProperty
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
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
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
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
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
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
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).
// 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
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
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
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
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
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
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
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
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
TransientProperty
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
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
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
public bool Unfocusable { get; set; }If true, the Window can't be focused nor interacted with. It can still be visible.
UnresizableProperty
public bool Unresizable { get; set; }If true, the window can't be resized.
VisibleProperty
public bool Visible { get; set; }If true, the window is visible.
WrapControlsProperty
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
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
color | Color | — |
AddThemeConstantOverridevoid
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
constant | int | — |
AddThemeFontOverridevoid
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
font | Font | — |
AddThemeFontSizeOverridevoid
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
fontSize | int | — |
AddThemeIconOverridevoid
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
texture | Texture2D | — |
AddThemeSoundOverridevoid
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
sound | AudioStream | — |
AddThemeStyleboxOverridevoid
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
stylebox | StyleBox | — |
BeginBulkThemeOverridevoid
public void BeginBulkThemeOverride();Prevents *_theme_*_override methods from emitting Window.NotificationThemeChanged until Window.EndBulkThemeOverride is called.
CanDrawbool
public bool CanDraw();Returns whether the window is being drawn to the screen.
boolChildControlsChangedvoid
public void ChildControlsChanged();Requests an update of the Window size to fit underlying Control nodes.
EndBulkThemeOverridevoid
public void EndBulkThemeOverride();Ends a bulk theme override update. See Window.BeginBulkThemeOverride.
GetAccessibilityDescriptionstring
public string GetAccessibilityDescription();stringGetAccessibilityNamestring
public string GetAccessibilityName();stringGetContentScaleAspectWindow.ContentScaleAspectEnum
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.
Window.ContentScaleAspectEnumValue of ContentScaleAspect; account for the documented distinction between a setting and its effective result.
GetContentScaleFactorfloat
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.
floatValue of ContentScaleFactor; account for the documented distinction between a setting and its effective result.
GetContentScaleModeWindow.ContentScaleModeEnum
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.
Window.ContentScaleModeEnumValue of ContentScaleMode; account for the documented distinction between a setting and its effective result.
GetContentScaleSizeVector2I
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.
Vector2IValue of ContentScaleSize; account for the documented distinction between a setting and its effective result.
GetContentScaleStretchWindow.ContentScaleStretchEnum
public Window.ContentScaleStretchEnum GetContentScaleStretch();Window.ContentScaleStretchEnumGetContentsMinimumSizeVector2
public Vector2 GetContentsMinimumSize();Virtual method to be implemented by the user. Overrides the value returned by Window.GetContentsMinimumSize.
Vector2GetCurrentScreenint
public int GetCurrentScreen();intGetFlagbool
public bool GetFlag(Window.Flags flag);Returns true if the flag is set.
| Name | Type | Default |
|---|---|---|
flag | Window.Flags | — |
boolGetFocusedWindowWindow
public static Window GetFocusedWindow();Returns the focused window.
WindowGetForceNativebool
public bool GetForceNative();boolGetInitialPositionWindow.WindowInitialPosition
public Window.WindowInitialPosition GetInitialPosition();Window.WindowInitialPositionGetKeepTitleVisiblebool
public bool GetKeepTitleVisible();boolGetLayoutDirectionWindow.LayoutDirection
public Window.LayoutDirection GetLayoutDirection();Returns layout direction and text writing direction.
Window.LayoutDirectionGetMaxSizeVector2I
public Vector2I GetMaxSize();Vector2IGetMinSizeVector2I
public Vector2I GetMinSize();Vector2IGetModeWindow.ModeEnum
public Window.ModeEnum GetMode();Window.ModeEnumGetMousePassthroughPolygonVector2[]
public Vector2[] GetMousePassthroughPolygon();Vector2[]GetNonclientAreaRect2I
public Rect2I GetNonclientArea();Rect2IGetOutputMaxLinearValuefloat
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.
floatGetPositionVector2I
public Vector2I GetPosition();Vector2IGetPositionWithDecorationsVector2I
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.
Vector2IGetSizeVector2I
public Vector2I GetSize();Vector2IGetSizeWithDecorationsVector2I
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.
Vector2IGetThemeTheme
public Theme GetTheme();ThemeGetThemeColorColor
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
ColorGetThemeConstantint
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
intGetThemeDefaultBaseScalefloat
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.
floatGetThemeDefaultFontFont
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.
FontGetThemeDefaultFontSizeint
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.
intGetThemeFontFont
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
FontGetThemeFontSizeint
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
intGetThemeIconTexture2D
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
Texture2DGetThemeSoundAudioStream
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
AudioStreamGetThemeStyleboxStyleBox
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
StyleBoxGetThemeTypeVariationStringName
public StringName GetThemeTypeVariation();StringNameGetTitlestring
public string GetTitle();stringGetWindowIdint
public int GetWindowId();Returns the ID of the window.
intGrabFocusvoid
public void GrabFocus();Causes the window to grab focus, allowing it to receive user input.
HasFocusbool
public bool HasFocus();Returns true if the window is focused.
boolHasThemeColorbool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeColorOverridebool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolHasThemeConstantbool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeConstantOverridebool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolHasThemeFontbool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeFontOverridebool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolHasThemeFontSizebool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeFontSizeOverridebool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolHasThemeIconbool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeIconOverridebool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolHasThemeSoundbool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeSoundOverridebool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolHasThemeStyleboxbool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeStyleboxOverridebool
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolHidevoid
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
public bool IsAutoTranslating();boolIsEmbeddedbool
public bool IsEmbedded();Returns true if the window is currently embedded in another window.
boolIsExclusivebool
public bool IsExclusive();boolIsFullscreenShortcutEnabledbool
public bool IsFullscreenShortcutEnabled();boolIsHdrOutputRequestedbool
public bool IsHdrOutputRequested();boolIsLayoutRtlbool
public bool IsLayoutRtl();Returns true if the layout is right-to-left.
boolIsMaximizeAllowedbool
public bool IsMaximizeAllowed();Returns true if the window can be maximized (the maximize button is enabled).
boolIsTransientbool
public bool IsTransient();boolIsTransientToFocusedbool
public bool IsTransientToFocused();boolIsUsingFontOversamplingbool
public bool IsUsingFontOversampling();Returns true if font oversampling is enabled. See Window.SetUseFontOversampling.
boolIsVisiblebool
public bool IsVisible();boolIsWrappingControlsbool
public bool IsWrappingControls();boolMoveToCentervoid
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
public void MoveToForeground();Causes the window to grab focus, allowing it to receive user input.
Popupvoid
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.
| Name | Type | Default |
|---|---|---|
rect | Rect2I? | default |
rectIf the parameter is null, then the default value is new Rect2I(new Vector2I(0, 0), new Vector2I(0, 0)).
PopupCenteredvoid
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.
| Name | Type | Default |
|---|---|---|
minsize | Vector2I? | default |
minsizeIf the parameter is null, then the default value is new Vector2I(0, 0).
PopupCenteredClampedvoid
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.
| Name | Type | Default |
|---|---|---|
minsize | Vector2I? | default |
fallbackRatio | float | 0.75f |
minsizeIf the parameter is null, then the default value is new Vector2I(0, 0).
PopupCenteredRatiovoid
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.
| Name | Type | Default |
|---|---|---|
ratio | float | 0.8f |
PopupExclusivevoid
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.
| Name | Type | Default |
|---|---|---|
fromNode | Entity | — |
rect | Rect2I? | default |
rectIf the parameter is null, then the default value is new Rect2I(new Vector2I(0, 0), new Vector2I(0, 0)).
PopupExclusiveCenteredvoid
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.
| Name | Type | Default |
|---|---|---|
fromNode | Entity | — |
minsize | Vector2I? | default |
minsizeIf the parameter is null, then the default value is new Vector2I(0, 0).
PopupExclusiveCenteredClampedvoid
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.
| Name | Type | Default |
|---|---|---|
fromNode | Entity | — |
minsize | Vector2I? | default |
fallbackRatio | float | 0.75f |
minsizeIf the parameter is null, then the default value is new Vector2I(0, 0).
PopupExclusiveCenteredRatiovoid
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.
| Name | Type | Default |
|---|---|---|
fromNode | Entity | — |
ratio | float | 0.8f |
PopupExclusiveOnParentvoid
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.
| Name | Type | Default |
|---|---|---|
fromNode | Entity | — |
parentRect | Rect2I | — |
PopupOnParentvoid
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.
| Name | Type | Default |
|---|---|---|
parentRect | Rect2I | — |
RemoveThemeColorOverridevoid
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RemoveThemeConstantOverridevoid
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RemoveThemeFontOverridevoid
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RemoveThemeFontSizeOverridevoid
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RemoveThemeIconOverridevoid
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RemoveThemeSoundOverridevoid
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RemoveThemeStyleboxOverridevoid
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.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RequestAttentionvoid
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
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
public void SetAccessibilityDescription(string description);| Name | Type | Default |
|---|---|---|
description | string | — |
SetAccessibilityNamevoid
public void SetAccessibilityName(string name);| Name | Type | Default |
|---|---|---|
name | string | — |
SetAutoTranslatevoid
public void SetAutoTranslate(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetContentScaleAspectvoid
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.
| Name | Type | Default |
|---|---|---|
aspect | Window.ContentScaleAspectEnum | — |
aspectAspect 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
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.
| Name | Type | Default |
|---|---|---|
factor | float | — |
factorScale 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
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.
| Name | Type | Default |
|---|---|---|
mode | Window.ContentScaleModeEnum | — |
modeWindow 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
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.
| Name | Type | Default |
|---|---|---|
size | Vector2I | — |
sizeBase 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
public void SetContentScaleStretch(Window.ContentScaleStretchEnum stretch);| Name | Type | Default |
|---|---|---|
stretch | Window.ContentScaleStretchEnum | — |
SetCurrentScreenvoid
public void SetCurrentScreen(int index);| Name | Type | Default |
|---|---|---|
index | int | — |
SetExclusivevoid
public void SetExclusive(bool exclusive);| Name | Type | Default |
|---|---|---|
exclusive | bool | — |
SetFlagvoid
public void SetFlag(Window.Flags flag, bool enabled);Sets a specified window flag.
| Name | Type | Default |
|---|---|---|
flag | Window.Flags | — |
enabled | bool | — |
SetForceNativevoid
public void SetForceNative(bool forceNative);| Name | Type | Default |
|---|---|---|
forceNative | bool | — |
SetFullscreenShortcutEnabledvoid
public void SetFullscreenShortcutEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetHdrOutputRequestedvoid
public void SetHdrOutputRequested(bool requested);| Name | Type | Default |
|---|---|---|
requested | bool | — |
SetImeActivevoid
public void SetImeActive(bool active);If active is true, enables system's native IME (Input Method Editor).
| Name | Type | Default |
|---|---|---|
active | bool | — |
SetImePositionvoid
public void SetImePosition(Vector2I position);Moves IME to the given position.
| Name | Type | Default |
|---|---|---|
position | Vector2I | — |
SetInitialPositionvoid
public void SetInitialPosition(Window.WindowInitialPosition initialPosition);| Name | Type | Default |
|---|---|---|
initialPosition | Window.WindowInitialPosition | — |
SetKeepTitleVisiblevoid
public void SetKeepTitleVisible(bool titleVisible);| Name | Type | Default |
|---|---|---|
titleVisible | bool | — |
SetLayoutDirectionvoid
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).
| Name | Type | Default |
|---|---|---|
direction | Window.LayoutDirection | — |
SetMaxSizevoid
public void SetMaxSize(Vector2I maxSize);| Name | Type | Default |
|---|---|---|
maxSize | Vector2I | — |
SetMinSizevoid
public void SetMinSize(Vector2I minSize);| Name | Type | Default |
|---|---|---|
minSize | Vector2I | — |
SetModevoid
public void SetMode(Window.ModeEnum mode);| Name | Type | Default |
|---|---|---|
mode | Window.ModeEnum | — |
SetMousePassthroughPolygon2 overloads
public void SetMousePassthroughPolygon(Vector2[] polygon);| Name | Type | Default |
|---|---|---|
polygon | Vector2[] | — |
public void SetMousePassthroughPolygon(ReadOnlySpan<Vector2> polygon);| Name | Type | Default |
|---|---|---|
polygon | ReadOnlySpan<Vector2> | — |
SetNonclientAreavoid
public void SetNonclientArea(Rect2I area);| Name | Type | Default |
|---|---|---|
area | Rect2I | — |
SetPositionvoid
public void SetPosition(Vector2I position);| Name | Type | Default |
|---|---|---|
position | Vector2I | — |
SetSizevoid
public void SetSize(Vector2I size);| Name | Type | Default |
|---|---|---|
size | Vector2I | — |
SetTaskbarProgressStatevoid
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.
| Name | Type | Default |
|---|---|---|
state | DisplayServer.ProgressState | — |
SetTaskbarProgressValuevoid
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.
| Name | Type | Default |
|---|---|---|
value | float | — |
SetThemevoid
public void SetTheme(Theme theme);| Name | Type | Default |
|---|---|---|
theme | Theme | — |
SetThemeTypeVariationvoid
public void SetThemeTypeVariation(StringName themeType);| Name | Type | Default |
|---|---|---|
themeType | StringName | — |
SetTitlevoid
public void SetTitle(string title);| Name | Type | Default |
|---|---|---|
title | string | — |
SetTransientvoid
public void SetTransient(bool transient);| Name | Type | Default |
|---|---|---|
transient | bool | — |
SetTransientToFocusedvoid
public void SetTransientToFocused(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetUnparentWhenInvisiblevoid
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.
| Name | Type | Default |
|---|---|---|
unparent | bool | — |
SetUseFontOversamplingvoid
public void SetUseFontOversampling(bool enable);Enables font oversampling. This makes fonts look better when they are scaled up.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetVisiblevoid
public void SetVisible(bool visible);| Name | Type | Default |
|---|---|---|
visible | bool | — |
SetWrapControlsvoid
public void SetWrapControls(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
Showvoid
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
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
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.
| Name | Type | Default |
|---|---|---|
edge | DisplayServer.WindowResizeEdge | — |
_GetContentsMinimumSizeVector2
public virtual Vector2 _GetContentsMinimumSize();Virtual method to be implemented by the user. Overrides the value returned by Window.GetContentsMinimumSize.
Vector2Signals and events16
AboutToPopupEvent
public event Action AboutToPopup;Emitted right after Window.Popup call, before the Window appears or does anything.
CloseRequestedEvent
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
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
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.
| Name | Type | Default |
|---|---|---|
files | string[] | — |
FocusEnteredEvent
public event Action FocusEntered;Emitted when the Window gains focus.
FocusExitedEvent
public event Action FocusExited;Emitted when the Window loses its focus.
GoBackRequestedEvent
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
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
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
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.
| Name | Type | Default |
|---|---|---|
event | InputEvent | — |
OutputMaxLinearValueChangedEvent
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.
| Name | Type | Default |
|---|---|---|
outputMaxLinearValue | double | — |
ThemeChangedEvent
public event Action ThemeChanged;Emitted when the Window.NotificationThemeChanged notification is sent.
TitleChangedEvent
public event Action TitleChanged;Emitted when window title bar text is changed.
TitlebarChangedEvent
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
public event Action VisibilityChanged;Emitted when Window is made visible or disappears.
WindowInputEvent
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.
| Name | Type | Default |
|---|---|---|
event | InputEvent | — |
Fields and constants2
NotificationThemeChangedField
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.Themeproperty is changed on this node or any of its ancestors. - The
Window.ThemeTypeVariationproperty 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
public const long NotificationVisibilityChanged = 30;Emitted when Window's visibility changes, right before Window.VisibilityChanged.
Window.ContentScaleAspectEnum
| Value | Description |
|---|---|
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
| Value | Description |
|---|---|
CanvasItems = 1 | The content will be rendered at the target size. This is more performance-expensive than |
Disabled = 0 | The content will not be scaled to match the |
Viewport = 2 | The content will be rendered at the base size and then scaled to the target size. More performant than |
Window.ContentScaleStretchEnum
| Value | Description |
|---|---|
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
| Value | Description |
|---|---|
AlwaysOnTop = 2 | The window is floating on top of all other windows. This flag is ignored for full-screen windows. Set with |
Borderless = 1 | The window do not have native title bar and other decorations. This flag is ignored for full-screen windows. Set with |
ExcludeFromCapture = 9 | Windows is excluded from screenshots taken by |
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 |
Max = 13 | Max value of the |
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 |
Popup = 5 | Window is part of menu or |
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 |
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.LayoutDirection
| Value | Description |
|---|---|
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 |
Rtl = 3 | Right-to-left layout direction. |
SystemLocale = 4 | Automatic layout direction, determined from the system locale. |
Window.ModeEnum
| Value | Description |
|---|---|
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 |
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. |
Minimized = 1 | Minimized window mode, i.e. |
Windowed = 0 | Windowed mode, i.e. |
Window.WindowInitialPosition
| Value | Description |
|---|---|
Absolute = 0 | Initial window position is determined by |
CenterMainWindowScreen = 2 | Initial window position is the center of the main window screen. |
CenterOtherScreen = 3 | Initial window position is the center of |
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 type | Description |
|---|---|
title_colorColor | The color of the title's text. Default:Color(0.875, 0.875, 0.875, 1) |
title_outline_modulateColor | The color of the title's text outline. Default:Color(0, 0, 0, 1) |
close_h_offsetint | 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_offsetint | 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_marginint | Defines the outside margin at which the window border can be grabbed with mouse and resized. Default:4 |
title_heightint | Height of the title bar. Default:36 |
title_outline_sizeint | The size of the title outline. Default:0 |
title_fontFont | The font used to draw the title. |
title_font_sizeint | The size of the title font. |
closeTexture2D | The icon for the close button. |
close_pressedTexture2D | The icon for the close button when it's being pressed. |
embedded_borderStyleBox | The background style used when the |
embedded_unfocused_borderStyleBox | The background style used when the |