Window

package
v0.0.0-...-c909628 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package Window provides methods for working with Window object instances.

Index

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 Any

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

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

type Instance [1]gdclass.Window

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 New

func New() Instance

func (Instance) AddThemeColorOverride

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

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

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

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

func (self Instance) AddThemeFontOverride(name string, font [1]gdclass.Font)

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

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

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

func (self Instance) AddThemeIconOverride(name string, texture [1]gdclass.Texture2D)

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

func (self Instance) AddThemeStyleboxOverride(name string, stylebox [1]gdclass.StyleBox)

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 (self Instance) AlwaysOnTop() bool

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

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

func (Instance) AsViewport

func (self Instance) AsViewport() Viewport.Instance

func (Instance) AsWindow

func (self Instance) AsWindow() Instance

func (Instance) AutoTranslate

func (self Instance) AutoTranslate() bool

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 (self Instance) Borderless() bool

func (Instance) CanDraw

func (self Instance) CanDraw() bool

Returns whether the window is being drawn to the screen.

func (Instance) ChildControlsChanged

func (self Instance) ChildControlsChanged()

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

func (Instance) ContentScaleAspect

func (self Instance) ContentScaleAspect() gdclass.WindowContentScaleAspect

func (Instance) ContentScaleFactor

func (self Instance) ContentScaleFactor() Float.X

func (Instance) ContentScaleMode

func (self Instance) ContentScaleMode() gdclass.WindowContentScaleMode

func (Instance) ContentScaleSize

func (self Instance) ContentScaleSize() Vector2i.XY

func (Instance) ContentScaleStretch

func (self Instance) ContentScaleStretch() gdclass.WindowContentScaleStretch

func (Instance) CurrentScreen

func (self Instance) CurrentScreen() int

func (Instance) EndBulkThemeOverride

func (self Instance) EndBulkThemeOverride()

Ends a bulk theme override update. See [method begin_bulk_theme_override].

func (Instance) Exclusive

func (self Instance) Exclusive() bool

func (Instance) ExtendToTitle

func (self Instance) ExtendToTitle() bool

func (Instance) ForceNative

func (self Instance) ForceNative() bool

func (Instance) GetContentsMinimumSize

func (self Instance) GetContentsMinimumSize() Vector2.XY

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

func (self Instance) GetPositionWithDecorations() Vector2i.XY

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

func (self Instance) GetSizeWithDecorations() Vector2i.XY

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

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

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

func (self Instance) GetThemeConstant(name string) int

Returns a constant from the first matching [Theme] in the tree if that [Theme] has a constant item with the specified [param name] and [param theme_type]. See [method Control.get_theme_color] for more details.

func (Instance) GetThemeDefaultBaseScale

func (self Instance) GetThemeDefaultBaseScale() Float.X

Returns the default base scale value from the first matching [Theme] in the tree if that [Theme] has a valid [member Theme.default_base_scale] value. See [method Control.get_theme_color] for details.

func (Instance) GetThemeDefaultFont

func (self Instance) GetThemeDefaultFont() [1]gdclass.Font

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

func (self Instance) GetThemeDefaultFontSize() int

Returns the default font size value from the first matching [Theme] in the tree if that [Theme] has a valid [member Theme.default_font_size] value. See [method Control.get_theme_color] for details.

func (Instance) GetThemeFont

func (self Instance) GetThemeFont(name string) [1]gdclass.Font

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

func (self Instance) GetThemeFontSize(name string) int

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

func (Instance) GetThemeIcon

func (self Instance) GetThemeIcon(name string) [1]gdclass.Texture2D

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

func (self Instance) GetThemeStylebox(name string) [1]gdclass.StyleBox

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

func (self Instance) GetWindowId() int

Returns the ID of the window.

func (Instance) GrabFocus

func (self Instance) GrabFocus()

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

func (Instance) HasFocus

func (self Instance) HasFocus() bool

Returns [code]true[/code] if the window is focused.

func (Instance) HasThemeColor

func (self Instance) HasThemeColor(name string) bool

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

func (self Instance) HasThemeColorOverride(name string) bool

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

func (self Instance) HasThemeConstant(name string) bool

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

func (self Instance) HasThemeConstantOverride(name string) bool

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

func (self Instance) HasThemeFont(name string) bool

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

func (self Instance) HasThemeFontOverride(name string) bool

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

func (self Instance) HasThemeFontSize(name string) bool

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

func (self Instance) HasThemeFontSizeOverride(name string) bool

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

func (self Instance) HasThemeIcon(name string) bool

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

func (self Instance) HasThemeIconOverride(name string) bool

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

func (self Instance) HasThemeStylebox(name string) bool

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

func (self Instance) HasThemeStyleboxOverride(name string) bool

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

func (self Instance) IsEmbedded() bool

Returns [code]true[/code] if the window is currently embedded in another window.

func (Instance) IsLayoutRtl

func (self Instance) IsLayoutRtl() bool

Returns [code]true[/code] if layout is right-to-left.

func (Instance) IsMaximizeAllowed

func (self Instance) IsMaximizeAllowed() bool

Returns [code]true[/code] if the window can be maximized (the maximize button is enabled).

func (Instance) IsUsingFontOversampling

func (self Instance) IsUsingFontOversampling() bool

Returns [code]true[/code] if font oversampling is enabled. See [method set_use_font_oversampling].

func (Instance) KeepTitleVisible

func (self Instance) KeepTitleVisible() bool

func (Instance) MaxSize

func (self Instance) MaxSize() Vector2i.XY

func (Instance) MinSize

func (self Instance) MinSize() Vector2i.XY

func (Instance) Mode

func (self Instance) Mode() gdclass.WindowMode

func (Instance) MousePassthrough

func (self Instance) MousePassthrough() bool

func (Instance) MousePassthroughPolygon

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

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 (self Instance) OnFilesDropped(cb func(files []string))

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

func (self Instance) PopupExclusive(from_node [1]gdclass.Node)

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

func (self Instance) PopupExclusiveCentered(from_node [1]gdclass.Node)

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

func (self Instance) PopupExclusiveCenteredClamped(from_node [1]gdclass.Node)

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

func (self Instance) PopupExclusiveCenteredRatio(from_node [1]gdclass.Node)

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 (self Instance) PopupWindow() bool

func (Instance) Position

func (self Instance) Position() Vector2i.XY

func (Instance) RemoveThemeColorOverride

func (self Instance) RemoveThemeColorOverride(name string)

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

func (self Instance) RemoveThemeConstantOverride(name string)

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

func (self Instance) RemoveThemeFontOverride(name string)

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

func (self Instance) RemoveThemeFontSizeOverride(name string)

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

func (self Instance) RemoveThemeIconOverride(name string)

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

func (self Instance) RemoveThemeStyleboxOverride(name string)

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 (self Instance) SetAlwaysOnTop(value bool)

func (Instance) SetAutoTranslate

func (self Instance) SetAutoTranslate(value bool)

func (Instance) SetBorderless

func (self Instance) SetBorderless(value bool)

func (Instance) SetContentScaleAspect

func (self Instance) SetContentScaleAspect(value gdclass.WindowContentScaleAspect)

func (Instance) SetContentScaleFactor

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

func (Instance) SetContentScaleMode

func (self Instance) SetContentScaleMode(value gdclass.WindowContentScaleMode)

func (Instance) SetContentScaleSize

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

func (Instance) SetContentScaleStretch

func (self Instance) SetContentScaleStretch(value gdclass.WindowContentScaleStretch)

func (Instance) SetCurrentScreen

func (self Instance) SetCurrentScreen(value int)

func (Instance) SetExclusive

func (self Instance) SetExclusive(value bool)

func (Instance) SetExtendToTitle

func (self Instance) SetExtendToTitle(value bool)

func (Instance) SetForceNative

func (self Instance) SetForceNative(value bool)

func (Instance) SetImeActive

func (self Instance) SetImeActive(active bool)

If [param active] is [code]true[/code], enables system's native IME (Input Method Editor).

func (Instance) SetImePosition

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

Moves IME to the given position.

func (Instance) SetInitialPosition

func (self Instance) SetInitialPosition(value gdclass.WindowWindowInitialPosition)

func (Instance) SetKeepTitleVisible

func (self Instance) SetKeepTitleVisible(value bool)

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 (self Instance) SetMaxSize(value Vector2i.XY)

func (Instance) SetMinSize

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

func (Instance) SetMode

func (self Instance) SetMode(value gdclass.WindowMode)

func (Instance) SetMousePassthrough

func (self Instance) SetMousePassthrough(value bool)

func (Instance) SetMousePassthroughPolygon

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

func (Instance) SetPopupWindow

func (self Instance) SetPopupWindow(value bool)

func (Instance) SetPosition

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

func (Instance) SetSize

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

func (Instance) SetTheme

func (self Instance) SetTheme(value [1]gdclass.Theme)

func (Instance) SetThemeTypeVariation

func (self Instance) SetThemeTypeVariation(value string)

func (Instance) SetTitle

func (self Instance) SetTitle(value string)

func (Instance) SetTransient

func (self Instance) SetTransient(value bool)

func (Instance) SetTransientToFocused

func (self Instance) SetTransientToFocused(value bool)

func (Instance) SetTransparent

func (self Instance) SetTransparent(value bool)

func (Instance) SetUnfocusable

func (self Instance) SetUnfocusable(value bool)

func (Instance) SetUnparentWhenInvisible

func (self Instance) SetUnparentWhenInvisible(unparent bool)

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 (self Instance) SetUnresizable(value bool)

func (Instance) SetUseFontOversampling

func (self Instance) SetUseFontOversampling(enable bool)

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

func (Instance) SetVisible

func (self Instance) SetVisible(value bool)

func (Instance) SetWrapControls

func (self Instance) SetWrapControls(value bool)

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

func (self Instance) Size() Vector2i.XY

func (Instance) Theme

func (self Instance) Theme() [1]gdclass.Theme

func (Instance) ThemeTypeVariation

func (self Instance) ThemeTypeVariation() string

func (Instance) Title

func (self Instance) Title() string

func (Instance) Transient

func (self Instance) Transient() bool

func (Instance) TransientToFocused

func (self Instance) TransientToFocused() bool

func (Instance) Transparent

func (self Instance) Transparent() bool

func (Instance) Unfocusable

func (self Instance) Unfocusable() bool

func (Instance) Unresizable

func (self Instance) Unresizable() bool

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

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

func (Instance) Visible

func (self Instance) Visible() bool

func (Instance) WrapControls

func (self Instance) WrapControls() bool

type Interface

type Interface interface {
	//Virtual method to be implemented by the user. Overrides the value returned by [method get_contents_minimum_size].
	GetContentsMinimumSize() Vector2.XY
}

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
)

Jump to

Keyboard shortcuts

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