Documentation
¶
Overview ¶
Package Window provides methods for working with Window object instances.
Index ¶
- type Advanced
- type Any
- type ContentScaleAspect
- type ContentScaleMode
- type ContentScaleStretch
- type Flags
- type Implementation
- type Instance
- func (self Instance) AddThemeColorOverride(name string, color Color.RGBA)
- func (self Instance) AddThemeConstantOverride(name string, constant int)
- func (self Instance) AddThemeFontOverride(name string, font [1]gdclass.Font)
- func (self Instance) AddThemeFontSizeOverride(name string, font_size int)
- func (self Instance) AddThemeIconOverride(name string, texture [1]gdclass.Texture2D)
- func (self Instance) AddThemeStyleboxOverride(name string, stylebox [1]gdclass.StyleBox)
- 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() gdclass.WindowContentScaleAspect
- func (self Instance) ContentScaleFactor() Float.X
- func (self Instance) ContentScaleMode() gdclass.WindowContentScaleMode
- func (self Instance) ContentScaleSize() Vector2i.XY
- func (self Instance) ContentScaleStretch() gdclass.WindowContentScaleStretch
- func (self Instance) CurrentScreen() int
- func (self Instance) EndBulkThemeOverride()
- func (self Instance) Exclusive() bool
- func (self Instance) ExtendToTitle() bool
- func (self Instance) ForceNative() bool
- func (self Instance) GetContentsMinimumSize() Vector2.XY
- func (self Instance) GetLayoutDirection() gdclass.WindowLayoutDirection
- 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() [1]gdclass.Font
- func (self Instance) GetThemeDefaultFontSize() int
- func (self Instance) GetThemeFont(name string) [1]gdclass.Font
- func (self Instance) GetThemeFontSize(name string) int
- func (self Instance) GetThemeIcon(name string) [1]gdclass.Texture2D
- func (self Instance) GetThemeStylebox(name string) [1]gdclass.StyleBox
- 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) InitialPosition() gdclass.WindowWindowInitialPosition
- 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) MinSize() Vector2i.XY
- func (self Instance) Mode() gdclass.WindowMode
- 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())
- func (self Instance) OnCloseRequested(cb func())
- func (self Instance) OnDpiChanged(cb func())
- func (self Instance) OnFilesDropped(cb func(files []string))
- func (self Instance) OnFocusEntered(cb func())
- func (self Instance) OnFocusExited(cb func())
- func (self Instance) OnGoBackRequested(cb func())
- func (self Instance) OnMouseEntered(cb func())
- func (self Instance) OnMouseExited(cb func())
- func (self Instance) OnThemeChanged(cb func())
- func (self Instance) OnTitlebarChanged(cb func())
- func (self Instance) OnVisibilityChanged(cb func())
- func (self Instance) OnWindowInput(cb func(event [1]gdclass.InputEvent))
- func (self Instance) Popup()
- func (self Instance) PopupCentered()
- func (self Instance) PopupCenteredClamped()
- func (self Instance) PopupCenteredRatio()
- func (self Instance) PopupExclusive(from_node [1]gdclass.Node)
- func (self Instance) PopupExclusiveCentered(from_node [1]gdclass.Node)
- func (self Instance) PopupExclusiveCenteredClamped(from_node [1]gdclass.Node)
- func (self Instance) PopupExclusiveCenteredRatio(from_node [1]gdclass.Node)
- func (self Instance) PopupExclusiveOnParent(from_node [1]gdclass.Node, parent_rect Rect2i.PositionSize)
- func (self Instance) PopupOnParent(parent_rect Rect2i.PositionSize)
- func (self Instance) PopupWindow() 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) SetAlwaysOnTop(value bool)
- func (self Instance) SetAutoTranslate(value bool)
- func (self Instance) SetBorderless(value bool)
- func (self Instance) SetContentScaleAspect(value gdclass.WindowContentScaleAspect)
- func (self Instance) SetContentScaleFactor(value Float.X)
- func (self Instance) SetContentScaleMode(value gdclass.WindowContentScaleMode)
- func (self Instance) SetContentScaleSize(value Vector2i.XY)
- func (self Instance) SetContentScaleStretch(value gdclass.WindowContentScaleStretch)
- func (self Instance) SetCurrentScreen(value int)
- 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 gdclass.WindowWindowInitialPosition)
- func (self Instance) SetKeepTitleVisible(value bool)
- func (self Instance) SetLayoutDirection(direction gdclass.WindowLayoutDirection)
- func (self Instance) SetMaxSize(value Vector2i.XY)
- func (self Instance) SetMinSize(value Vector2i.XY)
- func (self Instance) SetMode(value gdclass.WindowMode)
- func (self Instance) SetMousePassthrough(value bool)
- func (self Instance) SetMousePassthroughPolygon(value []Vector2.XY)
- func (self Instance) SetPopupWindow(value bool)
- func (self Instance) SetPosition(value Vector2i.XY)
- func (self Instance) SetSize(value Vector2i.XY)
- func (self Instance) SetTheme(value [1]gdclass.Theme)
- 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) Show()
- func (self Instance) Size() Vector2i.XY
- func (self Instance) Theme() [1]gdclass.Theme
- 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) UnsafePointer() unsafe.Pointer
- 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 WindowInitialPosition
Constants ¶
This section is empty.
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 = gdclass.WindowContentScaleAspect //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 = gdclass.WindowContentScaleMode //gd:Window.ContentScaleMode
const ( /*The content will not be scaled to match the [Window]'s size.*/ ContentScaleModeDisabled ContentScaleMode = 0 /*The content will be rendered at the target size. This is more performance-expensive than [constant CONTENT_SCALE_MODE_VIEWPORT], 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 [constant CONTENT_SCALE_MODE_CANVAS_ITEMS], but results in pixelated image.*/ ContentScaleModeViewport ContentScaleMode = 2 )
type ContentScaleStretch ¶
type ContentScaleStretch = gdclass.WindowContentScaleStretch //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 Flags ¶
type Flags = gdclass.WindowFlags //gd:Window.Flags
const ( /*The window can't be resized by dragging its resize grip. It's still possible to resize the window using [member size]. This flag is ignored for full screen windows. Set with [member 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 [member borderless].*/ FlagBorderless Flags = 1 /*The window is floating on top of all other windows. This flag is ignored for full-screen windows. Set with [member always_on_top].*/ FlagAlwaysOnTop Flags = 2 /*The window background can be transparent. Set with [member transparent]. [b]Note:[/b] This flag has no effect if either [member ProjectSettings.display/window/per_pixel_transparency/allowed], or the window's [member Viewport.transparent_bg] is set to [code]false[/code].*/ FlagTransparent Flags = 3 /*The window can't be focused. No-focus window will ignore all input, except mouse clicks. Set with [member 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 [member transient]). [b]Note:[/b] This flag has no effect in embedded windows (unless said window is a [Popup]).*/ 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 [member extend_to_title]. [b]Note:[/b] This flag is implemented only on macOS. [b]Note:[/b] This flag has no effect in embedded windows.*/ FlagExtendToTitle Flags = 6 /*All mouse events are passed to the underlying window of the same application. [b]Note:[/b] This flag has no effect in embedded windows.*/ FlagMousePassthrough Flags = 7 /*Max value of the [enum Flags].*/ FlagMax Flags = 8 )
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
A node that creates a window. The window can either be a native system window or embedded inside another [Window] (see [member Viewport.gui_embed_subwindows]). At runtime, [Window]s will not close automatically when requested. You need to handle it manually using the [signal close_requested] signal (this applies both to pressing the close button and clicking outside of a popup).
See [Interface] for methods that can be overridden by a [Class] that extends it.
%!(EXTRA string=Window)
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddThemeColorOverride ¶
Creates a local override for a theme [Color] with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_color_override]. See also [method get_theme_color] and [method Control.add_theme_color_override] for more details.
func (Instance) AddThemeConstantOverride ¶
Creates a local override for a theme constant with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_constant_override]. See also [method get_theme_constant].
func (Instance) AddThemeFontOverride ¶
Creates a local override for a theme [Font] with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_font_override]. See also [method get_theme_font].
func (Instance) AddThemeFontSizeOverride ¶
Creates a local override for a theme font size with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_font_size_override]. See also [method get_theme_font_size].
func (Instance) AddThemeIconOverride ¶
Creates a local override for a theme icon with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_icon_override]. See also [method get_theme_icon].
func (Instance) AddThemeStyleboxOverride ¶
Creates a local override for a theme [StyleBox] with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_stylebox_override]. See also [method get_theme_stylebox] and [method Control.add_theme_stylebox_override] for more details.
func (Instance) AlwaysOnTop ¶
func (Instance) AsViewport ¶
func (Instance) AutoTranslate ¶
func (Instance) BeginBulkThemeOverride ¶
func (self Instance) BeginBulkThemeOverride()
Prevents [code]*_theme_*_override[/code] methods from emitting [constant NOTIFICATION_THEME_CHANGED] until [method end_bulk_theme_override] is called.
func (Instance) Borderless ¶
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() gdclass.WindowContentScaleAspect
func (Instance) ContentScaleFactor ¶
func (Instance) ContentScaleMode ¶
func (self Instance) ContentScaleMode() gdclass.WindowContentScaleMode
func (Instance) ContentScaleSize ¶
func (Instance) ContentScaleStretch ¶
func (self Instance) ContentScaleStretch() gdclass.WindowContentScaleStretch
func (Instance) CurrentScreen ¶
func (Instance) EndBulkThemeOverride ¶
func (self Instance) EndBulkThemeOverride()
Ends a bulk theme override update. See [method begin_bulk_theme_override].
func (Instance) ExtendToTitle ¶
func (Instance) ForceNative ¶
func (Instance) GetContentsMinimumSize ¶
Returns the combined minimum size from the child [Control] nodes of the window. Use [method child_controls_changed] to update it when child nodes have changed. The value returned by this method can be overridden with [method _get_contents_minimum_size].
func (Instance) GetLayoutDirection ¶
func (self Instance) GetLayoutDirection() gdclass.WindowLayoutDirection
Returns layout direction and text writing direction.
func (Instance) GetPositionWithDecorations ¶
Returns the window's position including its border. [b]Note:[/b] If [member visible] is [code]false[/code], this method returns the same value as [member position].
func (Instance) GetSizeWithDecorations ¶
Returns the window's size including its border. [b]Note:[/b] If [member visible] is [code]false[/code], this method returns the same value as [member size].
func (Instance) GetThemeColor ¶
Returns a [Color] from the first matching [Theme] in the tree if that [Theme] has a color item with the specified [param name] and [param theme_type]. See [method Control.get_theme_color] 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 [param name] and [param theme_type]. See [method Control.get_theme_color] 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 [member Theme.default_base_scale] value. See [method Control.get_theme_color] for details.
func (Instance) GetThemeDefaultFont ¶
Returns the default font from the first matching [Theme] in the tree if that [Theme] has a valid [member Theme.default_font] value. See [method Control.get_theme_color] 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 [member Theme.default_font_size] value. See [method Control.get_theme_color] 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 [param name] and [param theme_type]. See [method Control.get_theme_color] 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 [param name] and [param theme_type]. See [method Control.get_theme_color] 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 [param name] and [param theme_type]. See [method Control.get_theme_color] 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 [param name] and [param theme_type]. See [method Control.get_theme_color] 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 [code]true[/code] if there is a matching [Theme] in the tree that has a color item with the specified [param name] and [param theme_type]. See [method Control.get_theme_color] for details.
func (Instance) HasThemeColorOverride ¶
Returns [code]true[/code] if there is a local override for a theme [Color] with the specified [param name] in this [Control] node. See [method add_theme_color_override].
func (Instance) HasThemeConstant ¶
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a constant item with the specified [param name] and [param theme_type]. See [method Control.get_theme_color] for details.
func (Instance) HasThemeConstantOverride ¶
Returns [code]true[/code] if there is a local override for a theme constant with the specified [param name] in this [Control] node. See [method add_theme_constant_override].
func (Instance) HasThemeFont ¶
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a font item with the specified [param name] and [param theme_type]. See [method Control.get_theme_color] for details.
func (Instance) HasThemeFontOverride ¶
Returns [code]true[/code] if there is a local override for a theme [Font] with the specified [param name] in this [Control] node. See [method add_theme_font_override].
func (Instance) HasThemeFontSize ¶
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a font size item with the specified [param name] and [param theme_type]. See [method Control.get_theme_color] for details.
func (Instance) HasThemeFontSizeOverride ¶
Returns [code]true[/code] if there is a local override for a theme font size with the specified [param name] in this [Control] node. See [method add_theme_font_size_override].
func (Instance) HasThemeIcon ¶
Returns [code]true[/code] if there is a matching [Theme] in the tree that has an icon item with the specified [param name] and [param theme_type]. See [method Control.get_theme_color] for details.
func (Instance) HasThemeIconOverride ¶
Returns [code]true[/code] if there is a local override for a theme icon with the specified [param name] in this [Control] node. See [method add_theme_icon_override].
func (Instance) HasThemeStylebox ¶
Returns [code]true[/code] if there is a matching [Theme] in the tree that has a stylebox item with the specified [param name] and [param theme_type]. See [method Control.get_theme_color] for details.
func (Instance) HasThemeStyleboxOverride ¶
Returns [code]true[/code] if there is a local override for a theme [StyleBox] with the specified [param name] in this [Control] node. See [method add_theme_stylebox_override].
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 [method show].
func (Instance) InitialPosition ¶
func (self Instance) InitialPosition() gdclass.WindowWindowInitialPosition
func (Instance) IsEmbedded ¶
Returns [code]true[/code] if the window is currently embedded in another window.
func (Instance) IsLayoutRtl ¶
Returns [code]true[/code] if layout is right-to-left.
func (Instance) IsMaximizeAllowed ¶
Returns [code]true[/code] if the window can be maximized (the maximize button is enabled).
func (Instance) IsUsingFontOversampling ¶
Returns [code]true[/code] if font oversampling is enabled. See [method set_use_font_oversampling].
func (Instance) KeepTitleVisible ¶
func (Instance) Mode ¶
func (self Instance) Mode() gdclass.WindowMode
func (Instance) MousePassthrough ¶
func (Instance) MousePassthroughPolygon ¶
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())
func (Instance) OnCloseRequested ¶
func (self Instance) OnCloseRequested(cb func())
func (Instance) OnDpiChanged ¶
func (self Instance) OnDpiChanged(cb func())
func (Instance) OnFilesDropped ¶
func (Instance) OnFocusEntered ¶
func (self Instance) OnFocusEntered(cb func())
func (Instance) OnFocusExited ¶
func (self Instance) OnFocusExited(cb func())
func (Instance) OnGoBackRequested ¶
func (self Instance) OnGoBackRequested(cb func())
func (Instance) OnMouseEntered ¶
func (self Instance) OnMouseEntered(cb func())
func (Instance) OnMouseExited ¶
func (self Instance) OnMouseExited(cb func())
func (Instance) OnThemeChanged ¶
func (self Instance) OnThemeChanged(cb func())
func (Instance) OnTitlebarChanged ¶
func (self Instance) OnTitlebarChanged(cb func())
func (Instance) OnVisibilityChanged ¶
func (self Instance) OnVisibilityChanged(cb func())
func (Instance) OnWindowInput ¶
func (self Instance) OnWindowInput(cb func(event [1]gdclass.InputEvent))
func (Instance) Popup ¶
func (self Instance) Popup()
Shows the [Window] and makes it transient (see [member transient]). If [param rect] is provided, it will be set as the [Window]'s size. Fails if called on the main window. If [member ProjectSettings.display/window/subwindows/embed_subwindows] is [code]true[/code] (single-window mode), [param rect]'s coordinates are global and relative to the main window's top-left corner (excluding window decorations). If [param rect]'s position coordinates are negative, the window will be located outside the main window and may not be visible as a result. If [member ProjectSettings.display/window/subwindows/embed_subwindows] is [code]false[/code] (multi-window mode), [param rect]'s coordinates are global and relative to the top-left corner of the leftmost screen. If [param rect]'s position coordinates are negative, the window will be placed at the top-left corner of the screen. [b]Note:[/b] [param 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. [b]Note:[/b] Calling it with the default value of [param minsize] is equivalent to calling it with [member size].
func (Instance) PopupCenteredClamped ¶
func (self Instance) PopupCenteredClamped()
Popups the [Window] centered inside its parent [Window]. [param fallback_ratio] determines the maximum size of the [Window], in relation to its parent. [b]Note:[/b] Calling it with the default value of [param minsize] is equivalent to calling it with [member 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 [param 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 [param ratio] of the screen size.
func (Instance) PopupExclusive ¶
Attempts to parent this dialog to the last exclusive window relative to [param from_node], and then calls [method Window.popup] on it. The dialog must have no current parent, otherwise the method fails. See also [method set_unparent_when_invisible] and [method Node.get_last_exclusive_window].
func (Instance) PopupExclusiveCentered ¶
Attempts to parent this dialog to the last exclusive window relative to [param from_node], and then calls [method Window.popup_centered] on it. The dialog must have no current parent, otherwise the method fails. See also [method set_unparent_when_invisible] and [method Node.get_last_exclusive_window].
func (Instance) PopupExclusiveCenteredClamped ¶
Attempts to parent this dialog to the last exclusive window relative to [param from_node], and then calls [method Window.popup_centered_clamped] on it. The dialog must have no current parent, otherwise the method fails. See also [method set_unparent_when_invisible] and [method Node.get_last_exclusive_window].
func (Instance) PopupExclusiveCenteredRatio ¶
Attempts to parent this dialog to the last exclusive window relative to [param from_node], and then calls [method Window.popup_centered_ratio] on it. The dialog must have no current parent, otherwise the method fails. See also [method set_unparent_when_invisible] and [method Node.get_last_exclusive_window].
func (Instance) PopupExclusiveOnParent ¶
func (self Instance) PopupExclusiveOnParent(from_node [1]gdclass.Node, parent_rect Rect2i.PositionSize)
Attempts to parent this dialog to the last exclusive window relative to [param from_node], and then calls [method Window.popup_on_parent] on it. The dialog must have no current parent, otherwise the method fails. See also [method set_unparent_when_invisible] and [method Node.get_last_exclusive_window].
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 [method popup].
func (Instance) PopupWindow ¶
func (Instance) RemoveThemeColorOverride ¶
Removes a local override for a theme [Color] with the specified [param name] previously added by [method add_theme_color_override] or via the Inspector dock.
func (Instance) RemoveThemeConstantOverride ¶
Removes a local override for a theme constant with the specified [param name] previously added by [method add_theme_constant_override] or via the Inspector dock.
func (Instance) RemoveThemeFontOverride ¶
Removes a local override for a theme [Font] with the specified [param name] previously added by [method add_theme_font_override] or via the Inspector dock.
func (Instance) RemoveThemeFontSizeOverride ¶
Removes a local override for a theme font size with the specified [param name] previously added by [method add_theme_font_size_override] or via the Inspector dock.
func (Instance) RemoveThemeIconOverride ¶
Removes a local override for a theme icon with the specified [param name] previously added by [method add_theme_icon_override] or via the Inspector dock.
func (Instance) RemoveThemeStyleboxOverride ¶
Removes a local override for a theme [StyleBox] with the specified [param name] previously added by [method add_theme_stylebox_override] 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 [member min_size] and (if [member wrap_controls] is enabled) [method get_contents_minimum_size]. This is equivalent to calling [code]set_size(Vector2i())[/code] (or any size below the minimum).
func (Instance) SetAlwaysOnTop ¶
func (Instance) SetAutoTranslate ¶
func (Instance) SetBorderless ¶
func (Instance) SetContentScaleAspect ¶
func (self Instance) SetContentScaleAspect(value gdclass.WindowContentScaleAspect)
func (Instance) SetContentScaleFactor ¶
func (Instance) SetContentScaleMode ¶
func (self Instance) SetContentScaleMode(value gdclass.WindowContentScaleMode)
func (Instance) SetContentScaleSize ¶
func (Instance) SetContentScaleStretch ¶
func (self Instance) SetContentScaleStretch(value gdclass.WindowContentScaleStretch)
func (Instance) SetCurrentScreen ¶
func (Instance) SetExclusive ¶
func (Instance) SetExtendToTitle ¶
func (Instance) SetForceNative ¶
func (Instance) SetImeActive ¶
If [param active] is [code]true[/code], 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 gdclass.WindowWindowInitialPosition)
func (Instance) SetKeepTitleVisible ¶
func (Instance) SetLayoutDirection ¶
func (self Instance) SetLayoutDirection(direction gdclass.WindowLayoutDirection)
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 (Instance) SetMinSize ¶
func (Instance) SetMode ¶
func (self Instance) SetMode(value gdclass.WindowMode)
func (Instance) SetMousePassthrough ¶
func (Instance) SetMousePassthroughPolygon ¶
func (Instance) SetPopupWindow ¶
func (Instance) SetPosition ¶
func (Instance) SetThemeTypeVariation ¶
func (Instance) SetTransient ¶
func (Instance) SetTransientToFocused ¶
func (Instance) SetTransparent ¶
func (Instance) SetUnfocusable ¶
func (Instance) SetUnparentWhenInvisible ¶
If [param unparent] is [code]true[/code], the window is automatically unparented when going invisible. [b]Note:[/b] Make sure to keep a reference to the node, otherwise it will be orphaned. You also need to manually call [method Node.queue_free] to free the window if it's not parented.
func (Instance) SetUnresizable ¶
func (Instance) SetUseFontOversampling ¶
Enables font oversampling. This makes fonts look better when they are scaled up.
func (Instance) SetVisible ¶
func (Instance) SetWrapControls ¶
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. [method popup]).
func (Instance) ThemeTypeVariation ¶
func (Instance) TransientToFocused ¶
func (Instance) Transparent ¶
func (Instance) Unfocusable ¶
func (Instance) Unresizable ¶
func (*Instance) UnsafePointer ¶
func (Instance) WrapControls ¶
type LayoutDirection ¶
type LayoutDirection = gdclass.WindowLayoutDirection //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.*/ LayoutDirectionLocale LayoutDirection = 1 /*Left-to-right layout direction.*/ LayoutDirectionLtr LayoutDirection = 2 /*Right-to-left layout direction.*/ LayoutDirectionRtl LayoutDirection = 3 )
type Mode ¶
type Mode = gdclass.WindowMode //gd:Window.Mode
const ( /*Windowed mode, i.e. [Window] doesn't occupy the whole screen (unless set to the size of the screen).*/ 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.*/ 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.*/ 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. [b]On Windows:[/b] Multi-window full-screen mode has a 1px border of the [member ProjectSettings.rendering/environment/defaults/default_clear_color] color. [b]On macOS:[/b] A new desktop is used to display the running project. [b]Note:[/b] Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling full screen mode.*/ 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. [b]On Windows:[/b] Depending on video driver, full screen transition might cause screens to go black for a moment. [b]On macOS:[/b] 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. [b]On Linux (X11):[/b] Exclusive full screen mode bypasses compositor. [b]Note:[/b] Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling full screen mode.*/ ModeExclusiveFullscreen Mode = 4 )
type WindowInitialPosition ¶
type WindowInitialPosition = gdclass.WindowWindowInitialPosition //gd:Window.WindowInitialPosition
const ( /*Initial window position is determined by [member 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 [member current_screen] screen.*/ 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 )