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
- type Advanced
- type Any
- type ContentScaleAspect
- type ContentScaleMode
- type ContentScaleStretch
- type Expanded
- type Extension
- type Flags
- type ID
- type Implementation
- type Instance
- func (self Instance) AccessibilityDescription() string
- func (self Instance) AccessibilityName() string
- func (self Instance) AddThemeColorOverride(name string, color Color.RGBA)
- func (self Instance) AddThemeConstantOverride(name string, constant int)
- func (self Instance) AddThemeFontOverride(name string, font Font.Instance)
- func (self Instance) AddThemeFontSizeOverride(name string, font_size int)
- func (self Instance) AddThemeIconOverride(name string, texture Texture2D.Instance)
- func (self Instance) AddThemeStyleboxOverride(name string, stylebox StyleBox.Instance)
- func (self Instance) AlwaysOnTop() bool
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsViewport() Viewport.Instance
- func (self Instance) AsWindow() Instance
- func (self Instance) AutoTranslate() bool
- func (self Instance) BeginBulkThemeOverride()
- func (self Instance) Borderless() bool
- func (self Instance) CanDraw() bool
- func (self Instance) ChildControlsChanged()
- func (self Instance) ContentScaleAspect() ContentScaleAspect
- func (self Instance) ContentScaleFactor() Float.X
- func (self Instance) ContentScaleMode() ContentScaleMode
- func (self Instance) ContentScaleSize() Vector2i.XY
- func (self Instance) ContentScaleStretch() ContentScaleStretch
- func (self Instance) CurrentScreen() int
- func (self Instance) EndBulkThemeOverride()
- func (self Instance) ExcludeFromCapture() bool
- func (self Instance) Exclusive() bool
- func (self Instance) ExtendToTitle() bool
- func (self Instance) ForceNative() bool
- func (self Instance) GetContentsMinimumSize() Vector2.XY
- func (self Instance) GetEmbeddedInView(peer Viewport.Instance) []Instance
- func (self Instance) GetLayoutDirection() LayoutDirection
- func (self Instance) GetPositionWithDecorations() Vector2i.XY
- func (self Instance) GetSizeWithDecorations() Vector2i.XY
- func (self Instance) GetThemeColor(name string) Color.RGBA
- func (self Instance) GetThemeConstant(name string) int
- func (self Instance) GetThemeDefaultBaseScale() Float.X
- func (self Instance) GetThemeDefaultFont() Font.Instance
- func (self Instance) GetThemeDefaultFontSize() int
- func (self Instance) GetThemeFont(name string) Font.Instance
- func (self Instance) GetThemeFontSize(name string) int
- func (self Instance) GetThemeIcon(name string) Texture2D.Instance
- func (self Instance) GetThemeStylebox(name string) StyleBox.Instance
- func (self Instance) GetWindowId() int
- func (self Instance) GrabFocus()
- func (self Instance) HasFocus() bool
- func (self Instance) HasThemeColor(name string) bool
- func (self Instance) HasThemeColorOverride(name string) bool
- func (self Instance) HasThemeConstant(name string) bool
- func (self Instance) HasThemeConstantOverride(name string) bool
- func (self Instance) HasThemeFont(name string) bool
- func (self Instance) HasThemeFontOverride(name string) bool
- func (self Instance) HasThemeFontSize(name string) bool
- func (self Instance) HasThemeFontSizeOverride(name string) bool
- func (self Instance) HasThemeIcon(name string) bool
- func (self Instance) HasThemeIconOverride(name string) bool
- func (self Instance) HasThemeStylebox(name string) bool
- func (self Instance) HasThemeStyleboxOverride(name string) bool
- func (self Instance) Hide()
- func (self Instance) ID() ID
- func (self Instance) InitialPosition() WindowInitialPosition
- func (self Instance) IsEmbedded() bool
- func (self Instance) IsLayoutRtl() bool
- func (self Instance) IsMaximizeAllowed() bool
- func (self Instance) IsUsingFontOversampling() bool
- func (self Instance) KeepTitleVisible() bool
- func (self Instance) MaxSize() Vector2i.XY
- func (self Instance) MaximizeDisabled() bool
- func (self Instance) MinSize() Vector2i.XY
- func (self Instance) MinimizeDisabled() bool
- func (self Instance) Mode() Mode
- func (self Instance) MoreArgs() MoreArgs
- func (self Instance) MousePassthrough() bool
- func (self Instance) MousePassthroughPolygon() []Vector2.XY
- func (self Instance) MoveToCenter()
- func (self Instance) MoveToForeground()
- func (self Instance) OnAboutToPopup(cb func(), flags ...Signal.Flags)
- func (self Instance) OnCloseRequested(cb func(), flags ...Signal.Flags)
- func (self Instance) OnDpiChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) OnFilesDropped(cb func(files []string), flags ...Signal.Flags)
- func (self Instance) OnFocusEntered(cb func(), flags ...Signal.Flags)
- func (self Instance) OnFocusExited(cb func(), flags ...Signal.Flags)
- func (self Instance) OnGoBackRequested(cb func(), flags ...Signal.Flags)
- func (self Instance) OnMouseEntered(cb func(), flags ...Signal.Flags)
- func (self Instance) OnMouseExited(cb func(), flags ...Signal.Flags)
- func (self Instance) OnThemeChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) OnTitleChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) OnTitlebarChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) OnVisibilityChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) OnWindowInput(cb func(event InputEvent.Instance), flags ...Signal.Flags)
- func (self Instance) Popup()
- func (self Instance) PopupCentered()
- func (self Instance) PopupCenteredClamped()
- func (self Instance) PopupCenteredRatio()
- func (self Instance) PopupExclusive(from_node Node.Instance)
- func (self Instance) PopupExclusiveCentered(from_node Node.Instance)
- func (self Instance) PopupExclusiveCenteredClamped(from_node Node.Instance)
- func (self Instance) PopupExclusiveCenteredRatio(from_node Node.Instance)
- func (self Instance) PopupExclusiveOnParent(from_node Node.Instance, parent_rect Rect2i.PositionSize)
- func (self Instance) PopupOnParent(parent_rect Rect2i.PositionSize)
- func (self Instance) PopupWindow() bool
- func (self Instance) PopupWmHint() bool
- func (self Instance) Position() Vector2i.XY
- func (self Instance) RemoveThemeColorOverride(name string)
- func (self Instance) RemoveThemeConstantOverride(name string)
- func (self Instance) RemoveThemeFontOverride(name string)
- func (self Instance) RemoveThemeFontSizeOverride(name string)
- func (self Instance) RemoveThemeIconOverride(name string)
- func (self Instance) RemoveThemeStyleboxOverride(name string)
- func (self Instance) RequestAttention()
- func (self Instance) ResetSize()
- func (self Instance) SetAccessibilityDescription(value string)
- func (self Instance) SetAccessibilityName(value string)
- func (self Instance) SetAlwaysOnTop(value bool)
- func (self Instance) SetAutoTranslate(value bool)
- func (self Instance) SetBorderless(value bool)
- func (self Instance) SetContentScaleAspect(value ContentScaleAspect)
- func (self Instance) SetContentScaleFactor(value Float.X)
- func (self Instance) SetContentScaleMode(value ContentScaleMode)
- func (self Instance) SetContentScaleSize(value Vector2i.XY)
- func (self Instance) SetContentScaleStretch(value ContentScaleStretch)
- func (self Instance) SetCurrentScreen(value int)
- func (self Instance) SetExcludeFromCapture(value bool)
- func (self Instance) SetExclusive(value bool)
- func (self Instance) SetExtendToTitle(value bool)
- func (self Instance) SetForceNative(value bool)
- func (self Instance) SetImeActive(active bool)
- func (self Instance) SetImePosition(position Vector2i.XY)
- func (self Instance) SetInitialPosition(value WindowInitialPosition)
- func (self Instance) SetKeepTitleVisible(value bool)
- func (self Instance) SetLayoutDirection(direction LayoutDirection)
- func (self Instance) SetMaxSize(value Vector2i.XY)
- func (self Instance) SetMaximizeDisabled(value bool)
- func (self Instance) SetMinSize(value Vector2i.XY)
- func (self Instance) SetMinimizeDisabled(value bool)
- func (self Instance) SetMode(value Mode)
- func (self Instance) SetMousePassthrough(value bool)
- func (self Instance) SetMousePassthroughPolygon(value []Vector2.XY)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetPopupWindow(value bool)
- func (self Instance) SetPopupWmHint(value bool)
- func (self Instance) SetPosition(value Vector2i.XY)
- func (self Instance) SetSharpCorners(value bool)
- func (self Instance) SetSize(value Vector2i.XY)
- func (self Instance) SetTheme(value Theme.Instance)
- func (self Instance) SetThemeTypeVariation(value string)
- func (self Instance) SetTitle(value string)
- func (self Instance) SetTransient(value bool)
- func (self Instance) SetTransientToFocused(value bool)
- func (self Instance) SetTransparent(value bool)
- func (self Instance) SetUnfocusable(value bool)
- func (self Instance) SetUnparentWhenInvisible(unparent bool)
- func (self Instance) SetUnresizable(value bool)
- func (self Instance) SetUseFontOversampling(enable bool)
- func (self Instance) SetVisible(value bool)
- func (self Instance) SetWrapControls(value bool)
- func (self Instance) SharpCorners() bool
- func (self Instance) Show()
- func (self Instance) Size() Vector2i.XY
- func (self Instance) StartDrag()
- func (self Instance) StartResize(edge DisplayServer.WindowResizeEdge)
- func (self Instance) Theme() Theme.Instance
- func (self Instance) ThemeTypeVariation() string
- func (self Instance) Title() string
- func (self Instance) Transient() bool
- func (self Instance) TransientToFocused() bool
- func (self Instance) Transparent() bool
- func (self Instance) Unfocusable() bool
- func (self Instance) Unresizable() bool
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) Visible() bool
- func (self Instance) WrapControls() bool
- type Interface
- type LayoutDirection
- type Mode
- type MoreArgs
- func (self MoreArgs) GetThemeColor(name string, theme_type string) Color.RGBA
- func (self MoreArgs) GetThemeConstant(name string, theme_type string) int
- func (self MoreArgs) GetThemeFont(name string, theme_type string) Font.Instance
- func (self MoreArgs) GetThemeFontSize(name string, theme_type string) int
- func (self MoreArgs) GetThemeIcon(name string, theme_type string) Texture2D.Instance
- func (self MoreArgs) GetThemeStylebox(name string, theme_type string) StyleBox.Instance
- func (self MoreArgs) HasThemeColor(name string, theme_type string) bool
- func (self MoreArgs) HasThemeConstant(name string, theme_type string) bool
- func (self MoreArgs) HasThemeFont(name string, theme_type string) bool
- func (self MoreArgs) HasThemeFontSize(name string, theme_type string) bool
- func (self MoreArgs) HasThemeIcon(name string, theme_type string) bool
- func (self MoreArgs) HasThemeStylebox(name string, theme_type string) bool
- func (self MoreArgs) Popup(rect Rect2i.PositionSize)
- func (self MoreArgs) PopupCentered(minsize Vector2i.XY)
- func (self MoreArgs) PopupCenteredClamped(minsize Vector2i.XY, fallback_ratio Float.X)
- func (self MoreArgs) PopupCenteredRatio(ratio Float.X)
- func (self MoreArgs) PopupExclusive(from_node Node.Instance, rect Rect2i.PositionSize)
- func (self MoreArgs) PopupExclusiveCentered(from_node Node.Instance, minsize Vector2i.XY)
- func (self MoreArgs) PopupExclusiveCenteredClamped(from_node Node.Instance, minsize Vector2i.XY, fallback_ratio Float.X)
- func (self MoreArgs) PopupExclusiveCenteredRatio(from_node Node.Instance, ratio Float.X)
- type WindowInitialPosition
Constants ¶
const NotificationThemeChanged Object.Notification = 32 //gd:Window.NOTIFICATION_THEME_CHANGED
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 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 Extension ¶
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]) AsViewport ¶
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 ¶
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.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
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 ¶
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 GetLastExclusive ¶
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 (Instance) AccessibilityDescription ¶
The human-readable node description that is reported to assistive apps.
func (Instance) AccessibilityName ¶
The human-readable node name that is reported to assistive apps.
func (Instance) AddThemeColorOverride ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
If true, the window will be on top of all other windows. Does not work if Transient is enabled.
func (Instance) AsViewport ¶
func (Instance) AutoTranslate ¶
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 ¶
If true, the window will have no borders.
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
If true, native window will be used regardless of parent viewport and project settings.
func (Instance) GetContentsMinimumSize ¶
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 ¶
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 ¶
Returns the window's position including its border.
Note: If Visible is false, this method returns the same value as Position.
func (Instance) GetSizeWithDecorations ¶
Returns the window's size including its border.
Note: If Visible is false, this method returns the same value as Size.
func (Instance) GetThemeColor ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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) GrabFocus ¶
func (self Instance) GrabFocus()
Causes the window to grab focus, allowing it to receive user input.
func (Instance) HasThemeColor ¶
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 ¶
Returns true if there is a local override for a theme Color.RGBA with the specified 'name' in this Control node.
func (Instance) HasThemeConstant ¶
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 ¶
Returns true if there is a local override for a theme constant with the specified 'name' in this Control node.
func (Instance) HasThemeFont ¶
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 ¶
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 ¶
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 ¶
Returns true if there is a local override for a theme font size with the specified 'name' in this Control node.
func (Instance) HasThemeIcon ¶
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 ¶
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 ¶
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 ¶
Returns true if there is a local override for a theme StyleBox with the specified 'name' in this Control node.
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) InitialPosition ¶
func (self Instance) InitialPosition() WindowInitialPosition
Specifies the initial type of position for the Window.
func (Instance) IsEmbedded ¶
Returns true if the window is currently embedded in another window.
func (Instance) IsLayoutRtl ¶
Returns true if the layout is right-to-left.
func (Instance) IsMaximizeAllowed ¶
Returns true if the window can be maximized (the maximize button is enabled).
func (Instance) IsUsingFontOversampling ¶
Returns true if font oversampling is enabled. See SetUseFontOversampling.
func (Instance) KeepTitleVisible ¶
If true, the Window width is expanded to keep the title bar text fully visible.
func (Instance) MaxSize ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
MoreArgs enables certain functions to be called with additional 'optional' arguments.
func (Instance) MousePassthrough ¶
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 ¶
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 ¶
Emitted right after Popup call, before the Window appears or does anything.
func (Instance) OnCloseRequested ¶
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 ¶
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 ¶
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 ¶
Emitted when the Window gains focus.
func (Instance) OnFocusExited ¶
Emitted when the Window loses its focus.
func (Instance) OnGoBackRequested ¶
Emitted when a go back request is sent (e.g. pressing the "Back" button on Android), right after [Node.NotificationWmGoBackRequest].
func (Instance) OnMouseEntered ¶
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 ¶
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 ¶
Emitted when the NotificationThemeChanged notification is sent.
func (Instance) OnTitleChanged ¶
Emitted when window title bar text is changed.
func (Instance) OnTitlebarChanged ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
Removes a local override for a theme constant with the specified 'name' previously added by AddThemeConstantOverride or via the Inspector dock.
func (Instance) RemoveThemeFontOverride ¶
Removes a local override for a theme Font with the specified 'name' previously added by AddThemeFontOverride or via the Inspector dock.
func (Instance) RemoveThemeFontSizeOverride ¶
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 ¶
Removes a local override for a theme icon with the specified 'name' previously added by AddThemeIconOverride or via the Inspector dock.
func (Instance) RemoveThemeStyleboxOverride ¶
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 ¶
SetAccessibilityDescription sets the property returned by [GetAccessibilityDescription].
func (Instance) SetAccessibilityName ¶
SetAccessibilityName sets the property returned by [GetAccessibilityName].
func (Instance) SetAlwaysOnTop ¶
SetAlwaysOnTop sets the property returned by [GetFlag].
func (Instance) SetAutoTranslate ¶
SetAutoTranslate sets the property returned by [IsAutoTranslating].
func (Instance) SetBorderless ¶
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 ¶
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 ¶
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 ¶
SetCurrentScreen sets the property returned by [GetCurrentScreen].
func (Instance) SetExcludeFromCapture ¶
SetExcludeFromCapture sets the property returned by [GetFlag].
func (Instance) SetExclusive ¶
SetExclusive sets the property returned by [IsExclusive].
func (Instance) SetExtendToTitle ¶
SetExtendToTitle sets the property returned by [GetFlag].
func (Instance) SetForceNative ¶
SetForceNative sets the property returned by [GetForceNative].
func (Instance) SetImeActive ¶
If 'active' is true, enables system's native IME (Input Method Editor).
func (Instance) SetImePosition ¶
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 ¶
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 ¶
SetMaxSize sets the property returned by [GetMaxSize].
func (Instance) SetMaximizeDisabled ¶
SetMaximizeDisabled sets the property returned by [GetFlag].
func (Instance) SetMinSize ¶
SetMinSize sets the property returned by [GetMinSize].
func (Instance) SetMinimizeDisabled ¶
SetMinimizeDisabled sets the property returned by [GetFlag].
func (Instance) SetMousePassthrough ¶
SetMousePassthrough sets the property returned by [GetFlag].
func (Instance) SetMousePassthroughPolygon ¶
SetMousePassthroughPolygon sets the property returned by [GetMousePassthroughPolygon].
func (Instance) SetPopupWindow ¶
SetPopupWindow sets the property returned by [GetFlag].
func (Instance) SetPopupWmHint ¶
SetPopupWmHint sets the property returned by [GetFlag].
func (Instance) SetPosition ¶
SetPosition sets the property returned by [GetPosition].
func (Instance) SetSharpCorners ¶
SetSharpCorners sets the property returned by [GetFlag].
func (Instance) SetThemeTypeVariation ¶
SetThemeTypeVariation sets the property returned by [GetThemeTypeVariation].
func (Instance) SetTransient ¶
SetTransient sets the property returned by [IsTransient].
func (Instance) SetTransientToFocused ¶
SetTransientToFocused sets the property returned by [IsTransientToFocused].
func (Instance) SetTransparent ¶
SetTransparent sets the property returned by [GetFlag].
func (Instance) SetUnfocusable ¶
SetUnfocusable sets the property returned by [GetFlag].
func (Instance) SetUnparentWhenInvisible ¶
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 ¶
SetUnresizable sets the property returned by [GetFlag].
func (Instance) SetUseFontOversampling ¶
Enables font oversampling. This makes fonts look better when they are scaled up.
func (Instance) SetVisible ¶
SetVisible sets the property returned by [IsVisible].
func (Instance) SetWrapControls ¶
SetWrapControls sets the property returned by [IsWrappingControls].
func (Instance) SharpCorners ¶
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) 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 ¶
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 ¶
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 ¶
The window's title. If the Window is native, title styles set in Theme will have no effect.
func (Instance) Transient ¶
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 ¶
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 ¶
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 ¶
If true, the Window can't be focused nor interacted with. It can still be visible.
func (Instance) Unresizable ¶
If true, the window can't be resized.
func (Instance) WrapControls ¶
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 ¶
MoreArgs is a container for Instance functions with additional 'optional' arguments.
func (MoreArgs) GetThemeColor ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 )