Window

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

A node that creates a window. The window can either be a native system window or embedded inside another Window (see Viewport.GuiEmbedSubwindows).

At runtime, Windows will not close automatically when requested. You need to handle it manually using the OnCloseRequested signal (this applies both to pressing the close button and clicking outside of a popup).

Index

Constants

View Source
const NotificationThemeChanged Object.Notification = 32 //gd:Window.NOTIFICATION_THEME_CHANGED
View Source
const NotificationVisibilityChanged Object.Notification = 30 //gd:Window.NOTIFICATION_VISIBILITY_CHANGED

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsWindow() Instance
}

type ContentScaleAspect

type ContentScaleAspect int //gd:Window.ContentScaleAspect
const (
	// The aspect will be ignored. Scaling will simply stretch the content to fit the target size.
	ContentScaleAspectIgnore ContentScaleAspect = 0
	// 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.
	ContentScaleAspectKeep ContentScaleAspect = 1
	// The content can be expanded vertically. Scaling horizontally will result in keeping the width ratio and then black bars on left and right sides.
	ContentScaleAspectKeepWidth ContentScaleAspect = 2
	// The content can be expanded horizontally. Scaling vertically will result in keeping the height ratio and then black bars on top and bottom sides.
	ContentScaleAspectKeepHeight ContentScaleAspect = 3
	// 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.
	ContentScaleAspectExpand ContentScaleAspect = 4
)

type ContentScaleMode

type ContentScaleMode int //gd:Window.ContentScaleMode
const (
	// The content will not be scaled to match the [Window]'s size.
	//
	// [Window]: https://pkg.go.dev/graphics.gd/classdb/Window
	ContentScaleModeDisabled ContentScaleMode = 0
	// The content will be rendered at the target size. This is more performance-expensive than [ContentScaleModeViewport], but provides better results.
	ContentScaleModeCanvasItems ContentScaleMode = 1
	// The content will be rendered at the base size and then scaled to the target size. More performant than [ContentScaleModeCanvasItems], but results in pixelated image.
	ContentScaleModeViewport ContentScaleMode = 2
)

type ContentScaleStretch

type ContentScaleStretch int //gd:Window.ContentScaleStretch
const (
	// 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.
	ContentScaleStretchFractional ContentScaleStretch = 0
	// 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.
	ContentScaleStretchInteger ContentScaleStretch = 1
)

type Expanded

type Expanded = MoreArgs

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this [Extension]See Interface for methods that can be overridden by T.

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsViewport

func (self *Extension[T]) AsViewport() Viewport.Instance

func (*Extension[T]) AsWindow

func (self *Extension[T]) AsWindow() Instance

type Flags

type Flags int //gd:Window.Flags
const (
	// The window can't be resized by dragging its resize grip. It's still possible to resize the window using [Size]. This flag is ignored for full screen windows. Set with [Unresizable].
	//
	// [Size]: https://pkg.go.dev/graphics.gd/classdb/#Instance.Size
	// [Unresizable]: https://pkg.go.dev/graphics.gd/classdb/#Instance.Unresizable
	FlagResizeDisabled Flags = 0
	// The window do not have native title bar and other decorations. This flag is ignored for full-screen windows. Set with [Borderless].
	//
	// [Borderless]: https://pkg.go.dev/graphics.gd/classdb/#Instance.Borderless
	FlagBorderless Flags = 1
	// The window is floating on top of all other windows. This flag is ignored for full-screen windows. Set with [AlwaysOnTop].
	//
	// [AlwaysOnTop]: https://pkg.go.dev/graphics.gd/classdb/#Instance.AlwaysOnTop
	FlagAlwaysOnTop Flags = 2
	// The window background can be transparent. Set with [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.
	//
	// [ProjectSettings]: https://pkg.go.dev/graphics.gd/classdb/ProjectSettings
	// [Transparent]: https://pkg.go.dev/graphics.gd/classdb/#Instance.Transparent
	// [Viewport.TransparentBg]: https://pkg.go.dev/graphics.gd/classdb/Viewport#Instance.TransparentBg
	FlagTransparent Flags = 3
	// The window can't be focused. No-focus window will ignore all input, except mouse clicks. Set with [Unfocusable].
	//
	// [Unfocusable]: https://pkg.go.dev/graphics.gd/classdb/#Instance.Unfocusable
	FlagNoFocus Flags = 4
	// 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 [Transient]).
	//
	// Note: This flag has no effect in embedded windows (unless said window is a [Popup]).
	//
	// [OptionButton]: https://pkg.go.dev/graphics.gd/classdb/OptionButton
	// [Popup]: https://pkg.go.dev/graphics.gd/classdb/Popup
	// [Transient]: https://pkg.go.dev/graphics.gd/classdb/#Instance.Transient
	FlagPopup Flags = 5
	// 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 [ExtendToTitle].
	//
	// Note: This flag is implemented only on macOS.
	//
	// Note: This flag has no effect in embedded windows.
	//
	// [ExtendToTitle]: https://pkg.go.dev/graphics.gd/classdb/#Instance.ExtendToTitle
	FlagExtendToTitle Flags = 6
	// All mouse events are passed to the underlying window of the same application.
	//
	// Note: This flag has no effect in embedded windows.
	FlagMousePassthrough Flags = 7
	// 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).
	FlagSharpCorners Flags = 8
	// 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.
	//
	// [DisplayServer.ScreenGetImage]: https://pkg.go.dev/graphics.gd/classdb/DisplayServer#ScreenGetImage
	// [DisplayServer.ScreenGetImageRect]: https://pkg.go.dev/graphics.gd/classdb/DisplayServer#ScreenGetImageRect
	// [DisplayServer.ScreenGetPixel]: https://pkg.go.dev/graphics.gd/classdb/DisplayServer#ScreenGetPixel
	FlagExcludeFromCapture Flags = 9
	// Signals the window manager that this window is supposed to be an implementation-defined "popup" (usually a floating, borderless, untileable and immovable child window).
	FlagPopupWmHint Flags = 10
	// Window minimize button is disabled.
	//
	// Note: This flag is implemented on macOS and Windows.
	FlagMinimizeDisabled Flags = 11
	// Window maximize button is disabled.
	//
	// Note: This flag is implemented on macOS and Windows.
	FlagMaximizeDisabled Flags = 12
	// Max value of the [Flags].
	FlagMax Flags = 13
)

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Implementation

type Implementation = implementation

Implementation implements Interface with empty methods.

type Instance

type Instance [1]gdclass.Window

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func Get

func Get(peer Node.Instance) Instance

Returns the [Window] that contains this node. If the node is in the main window, this is equivalent to getting the root node ([code]get_tree().get_root()[/code]).

func GetFocusedWindow

func GetFocusedWindow() Instance

Returns the focused window.

func GetLastExclusive

func GetLastExclusive(peer Node.Instance) Instance

Returns the [Window] that contains this node, or the last exclusive child in a chain of windows starting with the one that contains this node.

func New

func New() Instance

func (Instance) AccessibilityDescription

func (self Instance) AccessibilityDescription() string

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

func (Instance) AccessibilityName

func (self Instance) AccessibilityName() string

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

func (Instance) AddThemeColorOverride

func (self Instance) AddThemeColorOverride(name string, color Color.RGBA)

Creates a local override for a theme Color.RGBA with the specified 'name'. Local overrides always take precedence when fetching theme items for the control. An override can be removed with RemoveThemeColorOverride.

See also GetThemeColor and Control.AddThemeColorOverride for more details.

func (Instance) AddThemeConstantOverride

func (self Instance) AddThemeConstantOverride(name string, constant int)

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 RemoveThemeConstantOverride.

See also GetThemeConstant.

func (Instance) AddThemeFontOverride

func (self Instance) AddThemeFontOverride(name string, font Font.Instance)

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 RemoveThemeFontOverride.

See also GetThemeFont.

func (Instance) AddThemeFontSizeOverride

func (self Instance) AddThemeFontSizeOverride(name string, font_size int)

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 RemoveThemeFontSizeOverride.

See also GetThemeFontSize.

func (Instance) AddThemeIconOverride

func (self Instance) AddThemeIconOverride(name string, texture Texture2D.Instance)

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 RemoveThemeIconOverride.

See also GetThemeIcon.

func (Instance) AddThemeStyleboxOverride

func (self Instance) AddThemeStyleboxOverride(name string, stylebox StyleBox.Instance)

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 RemoveThemeStyleboxOverride.

See also GetThemeStylebox and Control.AddThemeStyleboxOverride for more details.

func (Instance) AlwaysOnTop

func (self Instance) AlwaysOnTop() bool

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

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsViewport

func (self Instance) AsViewport() Viewport.Instance

func (Instance) AsWindow

func (self Instance) AsWindow() Instance

func (Instance) AutoTranslate

func (self Instance) AutoTranslate() bool

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

func (Instance) BeginBulkThemeOverride

func (self Instance) BeginBulkThemeOverride()

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

func (Instance) Borderless

func (self Instance) Borderless() bool

If true, the window will have no borders.

func (Instance) CanDraw

func (self Instance) CanDraw() bool

Returns whether the window is being drawn to the screen.

func (Instance) ChildControlsChanged

func (self Instance) ChildControlsChanged()

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

func (Instance) ContentScaleAspect

func (self Instance) ContentScaleAspect() ContentScaleAspect

Specifies how the content's aspect behaves when the Window is resized. The base aspect is determined by ContentScaleSize.

func (Instance) ContentScaleFactor

func (self Instance) ContentScaleFactor() Float.X

Specifies the base scale of Window's content when its Size is equal to ContentScaleSize. See also Viewport.GetStretchTransform.

func (Instance) ContentScaleMode

func (self Instance) ContentScaleMode() ContentScaleMode

Specifies how the content is scaled when the Window is resized.

func (Instance) ContentScaleSize

func (self Instance) ContentScaleSize() Vector2i.XY

Base size of the content (i.e. nodes that are drawn inside the window). If non-zero, Window's content will be scaled when the window is resized to a different size.

func (Instance) ContentScaleStretch

func (self Instance) ContentScaleStretch() ContentScaleStretch

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

func (Instance) CurrentScreen

func (self Instance) CurrentScreen() int

The screen the window is currently on.

func (Instance) EndBulkThemeOverride

func (self Instance) EndBulkThemeOverride()

Ends a bulk theme override update. See BeginBulkThemeOverride.

func (Instance) ExcludeFromCapture

func (self Instance) ExcludeFromCapture() bool

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.

func (Instance) Exclusive

func (self Instance) Exclusive() bool

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 Transient enabled to work.

func (Instance) ExtendToTitle

func (self Instance) ExtendToTitle() bool

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.

func (Instance) ForceNative

func (self Instance) ForceNative() bool

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

func (Instance) GetContentsMinimumSize

func (self Instance) GetContentsMinimumSize() Vector2.XY

Returns the combined minimum size from the child Control nodes of the window. Use ChildControlsChanged to update it when child nodes have changed.

The value returned by this method can be overridden with GetContentsMinimumSize.

func (Instance) GetEmbeddedInView

func (self Instance) GetEmbeddedInView(peer Viewport.Instance) []Instance

Returns a list of the visible embedded [Window]s inside the viewport. [b]Note:[/b] [Window]s inside other viewports will not be listed.

func (Instance) GetLayoutDirection

func (self Instance) GetLayoutDirection() LayoutDirection

Returns layout direction and text writing direction.

func (Instance) GetPositionWithDecorations

func (self Instance) GetPositionWithDecorations() Vector2i.XY

Returns the window's position including its border.

Note: If Visible is false, this method returns the same value as Position.

func (Instance) GetSizeWithDecorations

func (self Instance) GetSizeWithDecorations() Vector2i.XY

Returns the window's size including its border.

Note: If Visible is false, this method returns the same value as Size.

func (Instance) GetThemeColor

func (self Instance) GetThemeColor(name string) Color.RGBA

Returns a Color.RGBA 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 more details.

func (Instance) GetThemeConstant

func (self Instance) GetThemeConstant(name string) int

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 more details.

func (Instance) GetThemeDefaultBaseScale

func (self Instance) GetThemeDefaultBaseScale() Float.X

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.

func (Instance) GetThemeDefaultFont

func (self Instance) GetThemeDefaultFont() Font.Instance

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.

func (Instance) GetThemeDefaultFontSize

func (self Instance) GetThemeDefaultFontSize() int

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.

func (Instance) GetThemeFont

func (self Instance) GetThemeFont(name string) Font.Instance

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.

func (Instance) GetThemeFontSize

func (self Instance) GetThemeFontSize(name string) int

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.

func (Instance) GetThemeIcon

func (self Instance) GetThemeIcon(name string) Texture2D.Instance

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.

func (Instance) GetThemeStylebox

func (self Instance) GetThemeStylebox(name string) StyleBox.Instance

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.

func (Instance) GetWindowId

func (self Instance) GetWindowId() int

Returns the ID of the window.

func (Instance) GrabFocus

func (self Instance) GrabFocus()

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

func (Instance) HasFocus

func (self Instance) HasFocus() bool

Returns true if the window is focused.

func (Instance) HasThemeColor

func (self Instance) HasThemeColor(name string) bool

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.

func (Instance) HasThemeColorOverride

func (self Instance) HasThemeColorOverride(name string) bool

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

See AddThemeColorOverride.

func (Instance) HasThemeConstant

func (self Instance) HasThemeConstant(name string) bool

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.

func (Instance) HasThemeConstantOverride

func (self Instance) HasThemeConstantOverride(name string) bool

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

See AddThemeConstantOverride.

func (Instance) HasThemeFont

func (self Instance) HasThemeFont(name string) bool

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.GetThemeColor for details.

func (Instance) HasThemeFontOverride

func (self Instance) HasThemeFontOverride(name string) bool

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

See AddThemeFontOverride.

func (Instance) HasThemeFontSize

func (self Instance) HasThemeFontSize(name string) bool

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.GetThemeColor for details.

func (Instance) HasThemeFontSizeOverride

func (self Instance) HasThemeFontSizeOverride(name string) bool

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

See AddThemeFontSizeOverride.

func (Instance) HasThemeIcon

func (self Instance) HasThemeIcon(name string) bool

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.GetThemeColor for details.

func (Instance) HasThemeIconOverride

func (self Instance) HasThemeIconOverride(name string) bool

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

See AddThemeIconOverride.

func (Instance) HasThemeStylebox

func (self Instance) HasThemeStylebox(name string) bool

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.GetThemeColor for details.

func (Instance) HasThemeStyleboxOverride

func (self Instance) HasThemeStyleboxOverride(name string) bool

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

See AddThemeStyleboxOverride.

func (Instance) Hide

func (self Instance) 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 Show.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) InitialPosition

func (self Instance) InitialPosition() WindowInitialPosition

Specifies the initial type of position for the Window.

func (Instance) IsEmbedded

func (self Instance) IsEmbedded() bool

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

func (Instance) IsLayoutRtl

func (self Instance) IsLayoutRtl() bool

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

func (Instance) IsMaximizeAllowed

func (self Instance) IsMaximizeAllowed() bool

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

func (Instance) IsUsingFontOversampling

func (self Instance) IsUsingFontOversampling() bool

Returns true if font oversampling is enabled. See SetUseFontOversampling.

func (Instance) KeepTitleVisible

func (self Instance) KeepTitleVisible() bool

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

func (Instance) MaxSize

func (self Instance) MaxSize() Vector2i.XY

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 MinSize.

func (Instance) MaximizeDisabled

func (self Instance) MaximizeDisabled() bool

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 only on macOS and Windows.

func (Instance) MinSize

func (self Instance) MinSize() Vector2i.XY

If non-zero, the Window can't be resized to be smaller than this size.

Note: This property will be ignored in favor of GetContentsMinimumSize if WrapControls is enabled and if its size is bigger.

func (Instance) MinimizeDisabled

func (self Instance) MinimizeDisabled() bool

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 only on macOS and Windows.

func (Instance) Mode

func (self Instance) Mode() Mode

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.

func (Instance) MoreArgs

func (self Instance) MoreArgs() MoreArgs

MoreArgs enables certain functions to be called with additional 'optional' arguments.

func (Instance) MousePassthrough

func (self Instance) MousePassthrough() bool

If true, all mouse events will be passed to the underlying window of the same application. See also MousePassthroughPolygon.

Note: This property is implemented on Linux (X11), macOS and Windows.

Note: This property only works with native windows.

func (Instance) MousePassthroughPolygon

func (self Instance) MousePassthroughPolygon() []Vector2.XY

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).

Note: This property is ignored if 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.

func (Instance) MoveToCenter

func (self Instance) MoveToCenter()

Centers a native window on the current screen and an embedded window on its embedder Viewport.

func (Instance) MoveToForeground

func (self Instance) MoveToForeground()

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

func (Instance) OnAboutToPopup

func (self Instance) OnAboutToPopup(cb func(), flags ...Signal.Flags)

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

func (Instance) OnCloseRequested

func (self Instance) OnCloseRequested(cb func(), flags ...Signal.Flags)

Emitted when the Window's close button is pressed or when PopupWindow is enabled and user clicks outside the window.

This signal can be used to handle window closing, e.g. by connecting it to Hide.

func (Instance) OnDpiChanged

func (self Instance) OnDpiChanged(cb func(), flags ...Signal.Flags)

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).

func (Instance) OnFilesDropped

func (self Instance) OnFilesDropped(cb func(files []string), flags ...Signal.Flags)

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.

func (Instance) OnFocusEntered

func (self Instance) OnFocusEntered(cb func(), flags ...Signal.Flags)

Emitted when the Window gains focus.

func (Instance) OnFocusExited

func (self Instance) OnFocusExited(cb func(), flags ...Signal.Flags)

Emitted when the Window loses its focus.

func (Instance) OnGoBackRequested

func (self Instance) OnGoBackRequested(cb func(), flags ...Signal.Flags)

Emitted when a go back request is sent (e.g. pressing the "Back" button on Android), right after [Node.NotificationWmGoBackRequest].

func (Instance) OnMouseEntered

func (self Instance) OnMouseEntered(cb func(), flags ...Signal.Flags)

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.

func (Instance) OnMouseExited

func (self Instance) OnMouseExited(cb func(), flags ...Signal.Flags)

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.

func (Instance) OnThemeChanged

func (self Instance) OnThemeChanged(cb func(), flags ...Signal.Flags)

Emitted when the NotificationThemeChanged notification is sent.

func (Instance) OnTitleChanged

func (self Instance) OnTitleChanged(cb func(), flags ...Signal.Flags)

Emitted when window title bar text is changed.

func (Instance) OnTitlebarChanged

func (self Instance) OnTitlebarChanged(cb func(), flags ...Signal.Flags)

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

func (Instance) OnVisibilityChanged

func (self Instance) OnVisibilityChanged(cb func(), flags ...Signal.Flags)

Emitted when Window is made visible or disappears.

func (Instance) OnWindowInput

func (self Instance) OnWindowInput(cb func(event InputEvent.Instance), flags ...Signal.Flags)

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.

func (Instance) Popup

func (self Instance) Popup()

Shows the Window and makes it transient (see 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.

func (Instance) PopupCentered

func (self Instance) PopupCentered()

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 Size.

func (Instance) PopupCenteredClamped

func (self Instance) PopupCenteredClamped()

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 Size.

func (Instance) PopupCenteredRatio

func (self Instance) PopupCenteredRatio()

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.

func (Instance) PopupExclusive

func (self Instance) PopupExclusive(from_node Node.Instance)

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 SetUnparentWhenInvisible and Node.GetLastExclusiveWindow.

func (Instance) PopupExclusiveCentered

func (self Instance) PopupExclusiveCentered(from_node Node.Instance)

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 SetUnparentWhenInvisible and Node.GetLastExclusiveWindow.

func (Instance) PopupExclusiveCenteredClamped

func (self Instance) PopupExclusiveCenteredClamped(from_node Node.Instance)

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 SetUnparentWhenInvisible and Node.GetLastExclusiveWindow.

func (Instance) PopupExclusiveCenteredRatio

func (self Instance) PopupExclusiveCenteredRatio(from_node Node.Instance)

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 SetUnparentWhenInvisible and Node.GetLastExclusiveWindow.

func (Instance) PopupExclusiveOnParent

func (self Instance) PopupExclusiveOnParent(from_node Node.Instance, parent_rect Rect2i.PositionSize)

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 SetUnparentWhenInvisible and Node.GetLastExclusiveWindow.

func (Instance) PopupOnParent

func (self Instance) PopupOnParent(parent_rect Rect2i.PositionSize)

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

func (Instance) PopupWindow

func (self Instance) PopupWindow() bool

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 Exclusive is enabled).

func (Instance) PopupWmHint

func (self Instance) PopupWmHint() bool

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).

func (Instance) Position

func (self Instance) Position() Vector2i.XY

The window's position in pixels.

If ProjectSettings "display/window/subwindows/embed_subwindows" is false, the position is in absolute screen coordinates. This typically applies to editor plugins. If the setting is true, the window's position is in the coordinates of its parent Viewport.

Note: This property only works if InitialPosition is set to WindowInitialPositionAbsolute.

func (Instance) RemoveThemeColorOverride

func (self Instance) RemoveThemeColorOverride(name string)

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

func (Instance) RemoveThemeConstantOverride

func (self Instance) RemoveThemeConstantOverride(name string)

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

func (Instance) RemoveThemeFontOverride

func (self Instance) RemoveThemeFontOverride(name string)

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

func (Instance) RemoveThemeFontSizeOverride

func (self Instance) RemoveThemeFontSizeOverride(name string)

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

func (Instance) RemoveThemeIconOverride

func (self Instance) RemoveThemeIconOverride(name string)

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

func (Instance) RemoveThemeStyleboxOverride

func (self Instance) RemoveThemeStyleboxOverride(name string)

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

func (Instance) RequestAttention

func (self Instance) 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.

func (Instance) ResetSize

func (self Instance) ResetSize()

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

func (Instance) SetAccessibilityDescription

func (self Instance) SetAccessibilityDescription(value string)

SetAccessibilityDescription sets the property returned by [GetAccessibilityDescription].

func (Instance) SetAccessibilityName

func (self Instance) SetAccessibilityName(value string)

SetAccessibilityName sets the property returned by [GetAccessibilityName].

func (Instance) SetAlwaysOnTop

func (self Instance) SetAlwaysOnTop(value bool)

SetAlwaysOnTop sets the property returned by [GetFlag].

func (Instance) SetAutoTranslate

func (self Instance) SetAutoTranslate(value bool)

SetAutoTranslate sets the property returned by [IsAutoTranslating].

func (Instance) SetBorderless

func (self Instance) SetBorderless(value bool)

SetBorderless sets the property returned by [GetFlag].

func (Instance) SetContentScaleAspect

func (self Instance) SetContentScaleAspect(value ContentScaleAspect)

SetContentScaleAspect sets the property returned by [GetContentScaleAspect].

func (Instance) SetContentScaleFactor

func (self Instance) SetContentScaleFactor(value Float.X)

SetContentScaleFactor sets the property returned by [GetContentScaleFactor].

func (Instance) SetContentScaleMode

func (self Instance) SetContentScaleMode(value ContentScaleMode)

SetContentScaleMode sets the property returned by [GetContentScaleMode].

func (Instance) SetContentScaleSize

func (self Instance) SetContentScaleSize(value Vector2i.XY)

SetContentScaleSize sets the property returned by [GetContentScaleSize].

func (Instance) SetContentScaleStretch

func (self Instance) SetContentScaleStretch(value ContentScaleStretch)

SetContentScaleStretch sets the property returned by [GetContentScaleStretch].

func (Instance) SetCurrentScreen

func (self Instance) SetCurrentScreen(value int)

SetCurrentScreen sets the property returned by [GetCurrentScreen].

func (Instance) SetExcludeFromCapture

func (self Instance) SetExcludeFromCapture(value bool)

SetExcludeFromCapture sets the property returned by [GetFlag].

func (Instance) SetExclusive

func (self Instance) SetExclusive(value bool)

SetExclusive sets the property returned by [IsExclusive].

func (Instance) SetExtendToTitle

func (self Instance) SetExtendToTitle(value bool)

SetExtendToTitle sets the property returned by [GetFlag].

func (Instance) SetForceNative

func (self Instance) SetForceNative(value bool)

SetForceNative sets the property returned by [GetForceNative].

func (Instance) SetImeActive

func (self Instance) SetImeActive(active bool)

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

func (Instance) SetImePosition

func (self Instance) SetImePosition(position Vector2i.XY)

Moves IME to the given position.

func (Instance) SetInitialPosition

func (self Instance) SetInitialPosition(value WindowInitialPosition)

SetInitialPosition sets the property returned by [GetInitialPosition].

func (Instance) SetKeepTitleVisible

func (self Instance) SetKeepTitleVisible(value bool)

SetKeepTitleVisible sets the property returned by [GetKeepTitleVisible].

func (Instance) SetLayoutDirection

func (self Instance) SetLayoutDirection(direction LayoutDirection)

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

func (Instance) SetMaxSize

func (self Instance) SetMaxSize(value Vector2i.XY)

SetMaxSize sets the property returned by [GetMaxSize].

func (Instance) SetMaximizeDisabled

func (self Instance) SetMaximizeDisabled(value bool)

SetMaximizeDisabled sets the property returned by [GetFlag].

func (Instance) SetMinSize

func (self Instance) SetMinSize(value Vector2i.XY)

SetMinSize sets the property returned by [GetMinSize].

func (Instance) SetMinimizeDisabled

func (self Instance) SetMinimizeDisabled(value bool)

SetMinimizeDisabled sets the property returned by [GetFlag].

func (Instance) SetMode

func (self Instance) SetMode(value Mode)

SetMode sets the property returned by [GetMode].

func (Instance) SetMousePassthrough

func (self Instance) SetMousePassthrough(value bool)

SetMousePassthrough sets the property returned by [GetFlag].

func (Instance) SetMousePassthroughPolygon

func (self Instance) SetMousePassthroughPolygon(value []Vector2.XY)

SetMousePassthroughPolygon sets the property returned by [GetMousePassthroughPolygon].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetPopupWindow

func (self Instance) SetPopupWindow(value bool)

SetPopupWindow sets the property returned by [GetFlag].

func (Instance) SetPopupWmHint

func (self Instance) SetPopupWmHint(value bool)

SetPopupWmHint sets the property returned by [GetFlag].

func (Instance) SetPosition

func (self Instance) SetPosition(value Vector2i.XY)

SetPosition sets the property returned by [GetPosition].

func (Instance) SetSharpCorners

func (self Instance) SetSharpCorners(value bool)

SetSharpCorners sets the property returned by [GetFlag].

func (Instance) SetSize

func (self Instance) SetSize(value Vector2i.XY)

SetSize sets the property returned by [GetSize].

func (Instance) SetTheme

func (self Instance) SetTheme(value Theme.Instance)

SetTheme sets the property returned by [GetTheme].

func (Instance) SetThemeTypeVariation

func (self Instance) SetThemeTypeVariation(value string)

SetThemeTypeVariation sets the property returned by [GetThemeTypeVariation].

func (Instance) SetTitle

func (self Instance) SetTitle(value string)

SetTitle sets the property returned by [GetTitle].

func (Instance) SetTransient

func (self Instance) SetTransient(value bool)

SetTransient sets the property returned by [IsTransient].

func (Instance) SetTransientToFocused

func (self Instance) SetTransientToFocused(value bool)

SetTransientToFocused sets the property returned by [IsTransientToFocused].

func (Instance) SetTransparent

func (self Instance) SetTransparent(value bool)

SetTransparent sets the property returned by [GetFlag].

func (Instance) SetUnfocusable

func (self Instance) SetUnfocusable(value bool)

SetUnfocusable sets the property returned by [GetFlag].

func (Instance) SetUnparentWhenInvisible

func (self Instance) SetUnparentWhenInvisible(unparent bool)

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 Node.QueueFree to free the window if it's not parented.

func (Instance) SetUnresizable

func (self Instance) SetUnresizable(value bool)

SetUnresizable sets the property returned by [GetFlag].

func (Instance) SetUseFontOversampling

func (self Instance) SetUseFontOversampling(enable bool)

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

func (Instance) SetVisible

func (self Instance) SetVisible(value bool)

SetVisible sets the property returned by [IsVisible].

func (Instance) SetWrapControls

func (self Instance) SetWrapControls(value bool)

SetWrapControls sets the property returned by [IsWrappingControls].

func (Instance) SharpCorners

func (self Instance) SharpCorners() bool

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.

func (Instance) Show

func (self Instance) 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. Popup).

func (Instance) Size

func (self Instance) Size() Vector2i.XY

The window's size in pixels.

func (Instance) StartDrag

func (self Instance) 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.

func (Instance) StartResize

func (self Instance) StartResize(edge DisplayServer.WindowResizeEdge)

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.

func (Instance) Theme

func (self Instance) Theme() Theme.Instance

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.

func (Instance) ThemeTypeVariation

func (self Instance) ThemeTypeVariation() string

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

func (Instance) Title

func (self Instance) Title() string

The window's title. If the Window is native, title styles set in Theme will have no effect.

func (Instance) Transient

func (self Instance) Transient() bool

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.

func (Instance) TransientToFocused

func (self Instance) TransientToFocused() bool

If true, and the Window is 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.

func (Instance) Transparent

func (self Instance) Transparent() bool

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.

func (Instance) Unfocusable

func (self Instance) Unfocusable() bool

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

func (Instance) Unresizable

func (self Instance) Unresizable() bool

If true, the window can't be resized.

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

func (Instance) Visible

func (self Instance) Visible() bool

If true, the window is visible.

func (Instance) WrapControls

func (self Instance) WrapControls() bool

If true, the window's size will automatically update when a child node is added or removed, ignoring MinSize if the new size is bigger.

If false, you need to call ChildControlsChanged manually.

type Interface

type Interface interface {
	// Virtual method to be implemented by the user. Overrides the value returned by [GetContentsMinimumSize].
	//
	// [GetContentsMinimumSize]: https://pkg.go.dev/graphics.gd/classdb/Window#Instance.GetContentsMinimumSize
	GetContentsMinimumSize() Vector2.XY
}

type LayoutDirection

type LayoutDirection int //gd:Window.LayoutDirection
const (
	// Automatic layout direction, determined from the parent window layout direction.
	LayoutDirectionInherited LayoutDirection = 0
	// Automatic layout direction, determined from the current locale.
	LayoutDirectionApplicationLocale LayoutDirection = 1
	// Left-to-right layout direction.
	LayoutDirectionLtr LayoutDirection = 2
	// Right-to-left layout direction.
	LayoutDirectionRtl LayoutDirection = 3
	// Automatic layout direction, determined from the system locale.
	LayoutDirectionSystemLocale LayoutDirection = 4
	// Represents the size of the [LayoutDirection] enum.
	LayoutDirectionMax    LayoutDirection = 5
	LayoutDirectionLocale LayoutDirection = 1
)

type Mode

type Mode int //gd:Window.Mode
const (
	// Windowed mode, i.e. [Window] doesn't occupy the whole screen (unless set to the size of the screen).
	//
	// [Window]: https://pkg.go.dev/graphics.gd/classdb/Window
	ModeWindowed Mode = 0
	// 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.
	//
	// [Window]: https://pkg.go.dev/graphics.gd/classdb/Window
	ModeMinimized Mode = 1
	// 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.
	//
	// [Window]: https://pkg.go.dev/graphics.gd/classdb/Window
	ModeMaximized Mode = 2
	// 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.
	//
	// [multiple resolutions]: https://docs.godotengine.org/tutorials/rendering/multiple_resolutions.html
	ModeFullscreen Mode = 3
	// 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 [ModeFullscreen].
	//
	// 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.
	//
	// [multiple resolutions]: https://docs.godotengine.org/tutorials/rendering/multiple_resolutions.html
	ModeExclusiveFullscreen Mode = 4
)

type MoreArgs

type MoreArgs [1]gdclass.Window

MoreArgs is a container for Instance functions with additional 'optional' arguments.

func (MoreArgs) GetThemeColor

func (self MoreArgs) GetThemeColor(name string, theme_type string) Color.RGBA

Returns a Color.RGBA 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 more details.

func (MoreArgs) GetThemeConstant

func (self MoreArgs) GetThemeConstant(name string, theme_type string) int

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 more details.

func (MoreArgs) GetThemeFont

func (self MoreArgs) GetThemeFont(name string, theme_type string) Font.Instance

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.

func (MoreArgs) GetThemeFontSize

func (self MoreArgs) GetThemeFontSize(name string, theme_type string) int

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.

func (MoreArgs) GetThemeIcon

func (self MoreArgs) GetThemeIcon(name string, theme_type string) Texture2D.Instance

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.

func (MoreArgs) GetThemeStylebox

func (self MoreArgs) GetThemeStylebox(name string, theme_type string) StyleBox.Instance

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.

func (MoreArgs) HasThemeColor

func (self MoreArgs) HasThemeColor(name string, theme_type string) bool

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.

func (MoreArgs) HasThemeConstant

func (self MoreArgs) HasThemeConstant(name string, theme_type string) bool

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.

func (MoreArgs) HasThemeFont

func (self MoreArgs) HasThemeFont(name string, theme_type string) bool

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.GetThemeColor for details.

func (MoreArgs) HasThemeFontSize

func (self MoreArgs) HasThemeFontSize(name string, theme_type string) bool

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.GetThemeColor for details.

func (MoreArgs) HasThemeIcon

func (self MoreArgs) HasThemeIcon(name string, theme_type string) bool

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.GetThemeColor for details.

func (MoreArgs) HasThemeStylebox

func (self MoreArgs) HasThemeStylebox(name string, theme_type string) bool

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.GetThemeColor for details.

func (MoreArgs) Popup

func (self MoreArgs) Popup(rect Rect2i.PositionSize)

Shows the Window and makes it transient (see 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.

func (MoreArgs) PopupCentered

func (self MoreArgs) PopupCentered(minsize Vector2i.XY)

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 Size.

func (MoreArgs) PopupCenteredClamped

func (self MoreArgs) PopupCenteredClamped(minsize Vector2i.XY, fallback_ratio Float.X)

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 Size.

func (MoreArgs) PopupCenteredRatio

func (self MoreArgs) PopupCenteredRatio(ratio Float.X)

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.

func (MoreArgs) PopupExclusive

func (self MoreArgs) PopupExclusive(from_node Node.Instance, rect Rect2i.PositionSize)

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 SetUnparentWhenInvisible and Node.GetLastExclusiveWindow.

func (MoreArgs) PopupExclusiveCentered

func (self MoreArgs) PopupExclusiveCentered(from_node Node.Instance, minsize Vector2i.XY)

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 SetUnparentWhenInvisible and Node.GetLastExclusiveWindow.

func (MoreArgs) PopupExclusiveCenteredClamped

func (self MoreArgs) PopupExclusiveCenteredClamped(from_node Node.Instance, minsize Vector2i.XY, fallback_ratio Float.X)

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 SetUnparentWhenInvisible and Node.GetLastExclusiveWindow.

func (MoreArgs) PopupExclusiveCenteredRatio

func (self MoreArgs) PopupExclusiveCenteredRatio(from_node Node.Instance, ratio Float.X)

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 SetUnparentWhenInvisible and Node.GetLastExclusiveWindow.

type WindowInitialPosition

type WindowInitialPosition int //gd:Window.WindowInitialPosition
const (
	// Initial window position is determined by [Position].
	//
	// [Position]: https://pkg.go.dev/graphics.gd/classdb/#Instance.Position
	WindowInitialPositionAbsolute WindowInitialPosition = 0
	// Initial window position is the center of the primary screen.
	WindowInitialPositionCenterPrimaryScreen WindowInitialPosition = 1
	// Initial window position is the center of the main window screen.
	WindowInitialPositionCenterMainWindowScreen WindowInitialPosition = 2
	// Initial window position is the center of [CurrentScreen] screen.
	//
	// [CurrentScreen]: https://pkg.go.dev/graphics.gd/classdb/#Instance.CurrentScreen
	WindowInitialPositionCenterOtherScreen WindowInitialPosition = 3
	// Initial window position is the center of the screen containing the mouse pointer.
	WindowInitialPositionCenterScreenWithMouseFocus WindowInitialPosition = 4
	// Initial window position is the center of the screen containing the window with the keyboard focus.
	WindowInitialPositionCenterScreenWithKeyboardFocus WindowInitialPosition = 5
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL