mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
2937 lines
158 KiB
ReStructuredText
2937 lines
158 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_Window:
|
||
|
||
Window
|
||
======
|
||
|
||
**繼承:** :ref:`Viewport<class_Viewport>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
||
**被繼承:** :ref:`AcceptDialog<class_AcceptDialog>`, :ref:`Popup<class_Popup>`
|
||
|
||
所有視窗、對話方塊、彈出框的基底類別。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
說明
|
||
----
|
||
|
||
建立視窗的節點。視窗可以是原生系統視窗,也可以是嵌入到其他 **Window** 中的視窗(見 :ref:`Viewport.gui_embed_subwindows<class_Viewport_property_gui_embed_subwindows>`\ )。
|
||
|
||
運作時,\ **Window** 不會在請求關閉時自動關閉。你需要使用 :ref:`close_requested<class_Window_signal_close_requested>` 訊號手動處理(適用於點擊關閉按鈕和點擊快顯視窗外部)。
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
屬性
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`String<class_String>` | :ref:`accessibility_description<class_Window_property_accessibility_description>` | ``""`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`String<class_String>` | :ref:`accessibility_name<class_Window_property_accessibility_name>` | ``""`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`always_on_top<class_Window_property_always_on_top>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`auto_translate<class_Window_property_auto_translate>` | |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`borderless<class_Window_property_borderless>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` | :ref:`content_scale_aspect<class_Window_property_content_scale_aspect>` | ``0`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`float<class_float>` | :ref:`content_scale_factor<class_Window_property_content_scale_factor>` | ``1.0`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`ContentScaleMode<enum_Window_ContentScaleMode>` | :ref:`content_scale_mode<class_Window_property_content_scale_mode>` | ``0`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`Vector2i<class_Vector2i>` | :ref:`content_scale_size<class_Window_property_content_scale_size>` | ``Vector2i(0, 0)`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`ContentScaleStretch<enum_Window_ContentScaleStretch>` | :ref:`content_scale_stretch<class_Window_property_content_scale_stretch>` | ``0`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`int<class_int>` | :ref:`current_screen<class_Window_property_current_screen>` | |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`exclude_from_capture<class_Window_property_exclude_from_capture>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`exclusive<class_Window_property_exclusive>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`extend_to_title<class_Window_property_extend_to_title>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`force_native<class_Window_property_force_native>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` | :ref:`initial_position<class_Window_property_initial_position>` | ``0`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`keep_title_visible<class_Window_property_keep_title_visible>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`Vector2i<class_Vector2i>` | :ref:`max_size<class_Window_property_max_size>` | ``Vector2i(0, 0)`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`maximize_disabled<class_Window_property_maximize_disabled>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`Vector2i<class_Vector2i>` | :ref:`min_size<class_Window_property_min_size>` | ``Vector2i(0, 0)`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`minimize_disabled<class_Window_property_minimize_disabled>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`Mode<enum_Window_Mode>` | :ref:`mode<class_Window_property_mode>` | ``0`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`mouse_passthrough<class_Window_property_mouse_passthrough>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`mouse_passthrough_polygon<class_Window_property_mouse_passthrough_polygon>` | ``PackedVector2Array()`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`Rect2i<class_Rect2i>` | :ref:`nonclient_area<class_Window_property_nonclient_area>` | ``Rect2i(0, 0, 0, 0)`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`popup_window<class_Window_property_popup_window>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`popup_wm_hint<class_Window_property_popup_wm_hint>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`Vector2i<class_Vector2i>` | :ref:`position<class_Window_property_position>` | ``Vector2i(0, 0)`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`sharp_corners<class_Window_property_sharp_corners>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`Vector2i<class_Vector2i>` | :ref:`size<class_Window_property_size>` | ``Vector2i(100, 100)`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`Theme<class_Theme>` | :ref:`theme<class_Window_property_theme>` | |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`StringName<class_StringName>` | :ref:`theme_type_variation<class_Window_property_theme_type_variation>` | ``&""`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`String<class_String>` | :ref:`title<class_Window_property_title>` | ``""`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`transient<class_Window_property_transient>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`transient_to_focused<class_Window_property_transient_to_focused>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`transparent<class_Window_property_transparent>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`unfocusable<class_Window_property_unfocusable>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`unresizable<class_Window_property_unresizable>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`visible<class_Window_property_visible>` | ``true`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`wrap_controls<class_Window_property_wrap_controls>` | ``false`` |
|
||
+-----------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
方法
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector2<class_Vector2>` | :ref:`_get_contents_minimum_size<class_Window_private_method__get_contents_minimum_size>`\ (\ ) |virtual| |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_theme_color_override<class_Window_method_add_theme_color_override>`\ (\ name\: :ref:`StringName<class_StringName>`, color\: :ref:`Color<class_Color>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_theme_constant_override<class_Window_method_add_theme_constant_override>`\ (\ name\: :ref:`StringName<class_StringName>`, constant\: :ref:`int<class_int>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_theme_font_override<class_Window_method_add_theme_font_override>`\ (\ name\: :ref:`StringName<class_StringName>`, font\: :ref:`Font<class_Font>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_theme_font_size_override<class_Window_method_add_theme_font_size_override>`\ (\ name\: :ref:`StringName<class_StringName>`, font_size\: :ref:`int<class_int>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_theme_icon_override<class_Window_method_add_theme_icon_override>`\ (\ name\: :ref:`StringName<class_StringName>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_theme_stylebox_override<class_Window_method_add_theme_stylebox_override>`\ (\ name\: :ref:`StringName<class_StringName>`, stylebox\: :ref:`StyleBox<class_StyleBox>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`begin_bulk_theme_override<class_Window_method_begin_bulk_theme_override>`\ (\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`can_draw<class_Window_method_can_draw>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`child_controls_changed<class_Window_method_child_controls_changed>`\ (\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`end_bulk_theme_override<class_Window_method_end_bulk_theme_override>`\ (\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector2<class_Vector2>` | :ref:`get_contents_minimum_size<class_Window_method_get_contents_minimum_size>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`get_flag<class_Window_method_get_flag>`\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Window<class_Window>` | :ref:`get_focused_window<class_Window_method_get_focused_window>`\ (\ ) |static| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`LayoutDirection<enum_Window_LayoutDirection>` | :ref:`get_layout_direction<class_Window_method_get_layout_direction>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector2i<class_Vector2i>` | :ref:`get_position_with_decorations<class_Window_method_get_position_with_decorations>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector2i<class_Vector2i>` | :ref:`get_size_with_decorations<class_Window_method_get_size_with_decorations>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_theme_color<class_Window_method_get_theme_color>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_theme_constant<class_Window_method_get_theme_constant>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`get_theme_default_base_scale<class_Window_method_get_theme_default_base_scale>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Font<class_Font>` | :ref:`get_theme_default_font<class_Window_method_get_theme_default_font>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_theme_default_font_size<class_Window_method_get_theme_default_font_size>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Font<class_Font>` | :ref:`get_theme_font<class_Window_method_get_theme_font>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_theme_font_size<class_Window_method_get_theme_font_size>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Texture2D<class_Texture2D>` | :ref:`get_theme_icon<class_Window_method_get_theme_icon>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`get_theme_stylebox<class_Window_method_get_theme_stylebox>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_window_id<class_Window_method_get_window_id>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`grab_focus<class_Window_method_grab_focus>`\ (\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_focus<class_Window_method_has_focus>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_theme_color<class_Window_method_has_theme_color>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_theme_color_override<class_Window_method_has_theme_color_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_theme_constant<class_Window_method_has_theme_constant>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_theme_constant_override<class_Window_method_has_theme_constant_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_theme_font<class_Window_method_has_theme_font>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_theme_font_override<class_Window_method_has_theme_font_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_theme_font_size<class_Window_method_has_theme_font_size>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_theme_font_size_override<class_Window_method_has_theme_font_size_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_theme_icon<class_Window_method_has_theme_icon>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_theme_icon_override<class_Window_method_has_theme_icon_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_theme_stylebox<class_Window_method_has_theme_stylebox>`\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_theme_stylebox_override<class_Window_method_has_theme_stylebox_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`hide<class_Window_method_hide>`\ (\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_embedded<class_Window_method_is_embedded>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_layout_rtl<class_Window_method_is_layout_rtl>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_maximize_allowed<class_Window_method_is_maximize_allowed>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_using_font_oversampling<class_Window_method_is_using_font_oversampling>`\ (\ ) |const| |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`move_to_center<class_Window_method_move_to_center>`\ (\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`move_to_foreground<class_Window_method_move_to_foreground>`\ (\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup<class_Window_method_popup>`\ (\ rect\: :ref:`Rect2i<class_Rect2i>` = Rect2i(0, 0, 0, 0)\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_centered<class_Window_method_popup_centered>`\ (\ minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0)\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_centered_clamped<class_Window_method_popup_centered_clamped>`\ (\ minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0), fallback_ratio\: :ref:`float<class_float>` = 0.75\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_centered_ratio<class_Window_method_popup_centered_ratio>`\ (\ ratio\: :ref:`float<class_float>` = 0.8\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_exclusive<class_Window_method_popup_exclusive>`\ (\ from_node\: :ref:`Node<class_Node>`, rect\: :ref:`Rect2i<class_Rect2i>` = Rect2i(0, 0, 0, 0)\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_exclusive_centered<class_Window_method_popup_exclusive_centered>`\ (\ from_node\: :ref:`Node<class_Node>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0)\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_exclusive_centered_clamped<class_Window_method_popup_exclusive_centered_clamped>`\ (\ from_node\: :ref:`Node<class_Node>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0), fallback_ratio\: :ref:`float<class_float>` = 0.75\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_exclusive_centered_ratio<class_Window_method_popup_exclusive_centered_ratio>`\ (\ from_node\: :ref:`Node<class_Node>`, ratio\: :ref:`float<class_float>` = 0.8\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_exclusive_on_parent<class_Window_method_popup_exclusive_on_parent>`\ (\ from_node\: :ref:`Node<class_Node>`, parent_rect\: :ref:`Rect2i<class_Rect2i>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`popup_on_parent<class_Window_method_popup_on_parent>`\ (\ parent_rect\: :ref:`Rect2i<class_Rect2i>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`remove_theme_color_override<class_Window_method_remove_theme_color_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`remove_theme_constant_override<class_Window_method_remove_theme_constant_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`remove_theme_font_override<class_Window_method_remove_theme_font_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`remove_theme_font_size_override<class_Window_method_remove_theme_font_size_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`remove_theme_icon_override<class_Window_method_remove_theme_icon_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`remove_theme_stylebox_override<class_Window_method_remove_theme_stylebox_override>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`request_attention<class_Window_method_request_attention>`\ (\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`reset_size<class_Window_method_reset_size>`\ (\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_flag<class_Window_method_set_flag>`\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_ime_active<class_Window_method_set_ime_active>`\ (\ active\: :ref:`bool<class_bool>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_ime_position<class_Window_method_set_ime_position>`\ (\ position\: :ref:`Vector2i<class_Vector2i>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_layout_direction<class_Window_method_set_layout_direction>`\ (\ direction\: :ref:`LayoutDirection<enum_Window_LayoutDirection>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_unparent_when_invisible<class_Window_method_set_unparent_when_invisible>`\ (\ unparent\: :ref:`bool<class_bool>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_use_font_oversampling<class_Window_method_set_use_font_oversampling>`\ (\ enable\: :ref:`bool<class_bool>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`show<class_Window_method_show>`\ (\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`start_drag<class_Window_method_start_drag>`\ (\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`start_resize<class_Window_method_start_resize>`\ (\ edge\: :ref:`WindowResizeEdge<enum_DisplayServer_WindowResizeEdge>`\ ) |
|
||
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
主題屬性
|
||
--------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`title_color<class_Window_theme_color_title_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`title_outline_modulate<class_Window_theme_color_title_outline_modulate>` | ``Color(0, 0, 0, 1)`` |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`close_h_offset<class_Window_theme_constant_close_h_offset>` | ``18`` |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`close_v_offset<class_Window_theme_constant_close_v_offset>` | ``24`` |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`resize_margin<class_Window_theme_constant_resize_margin>` | ``4`` |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`title_height<class_Window_theme_constant_title_height>` | ``36`` |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`title_outline_size<class_Window_theme_constant_title_outline_size>` | ``0`` |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`Font<class_Font>` | :ref:`title_font<class_Window_theme_font_title_font>` | |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`title_font_size<class_Window_theme_font_size_title_font_size>` | |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`Texture2D<class_Texture2D>` | :ref:`close<class_Window_theme_icon_close>` | |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`Texture2D<class_Texture2D>` | :ref:`close_pressed<class_Window_theme_icon_close_pressed>` | |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`embedded_border<class_Window_theme_style_embedded_border>` | |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`embedded_unfocused_border<class_Window_theme_style_embedded_unfocused_border>` | |
|
||
+-----------------------------------+--------------------------------------------------------------------------------------+-----------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
訊號
|
||
----
|
||
|
||
.. _class_Window_signal_about_to_popup:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**about_to_popup**\ (\ ) :ref:`🔗<class_Window_signal_about_to_popup>`
|
||
|
||
在呼叫 :ref:`popup()<class_Window_method_popup>` 之後但在 **Window** 出現或執行任何操作之前發送的訊號。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_close_requested:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**close_requested**\ (\ ) :ref:`🔗<class_Window_signal_close_requested>`
|
||
|
||
按下該 **Window** 的關閉按鈕或啟用 :ref:`popup_window<class_Window_property_popup_window>` 並且使用者在視窗外點擊時發出。
|
||
|
||
這個訊號可以用來處理視窗的關閉,例如將其連接到 :ref:`hide()<class_Window_method_hide>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_dpi_changed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**dpi_changed**\ (\ ) :ref:`🔗<class_Window_signal_dpi_changed>`
|
||
|
||
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).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_files_dropped:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**files_dropped**\ (\ files\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) :ref:`🔗<class_Window_signal_files_dropped>`
|
||
|
||
Emitted when files are dragged from the OS file manager and dropped in the game window. The argument is a list of file paths.
|
||
|
||
::
|
||
|
||
func _ready():
|
||
get_window().files_dropped.connect(on_files_dropped)
|
||
|
||
func on_files_dropped(files):
|
||
print(files)
|
||
|
||
\ **Note:** This signal only works with native windows, i.e. the main window and **Window**-derived nodes when :ref:`Viewport.gui_embed_subwindows<class_Viewport_property_gui_embed_subwindows>` is disabled in the main viewport.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_focus_entered:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**focus_entered**\ (\ ) :ref:`🔗<class_Window_signal_focus_entered>`
|
||
|
||
當該 **Window** 獲得焦點時發出。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_focus_exited:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**focus_exited**\ (\ ) :ref:`🔗<class_Window_signal_focus_exited>`
|
||
|
||
當該 **Window** 失去焦點時發出。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_go_back_requested:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**go_back_requested**\ (\ ) :ref:`🔗<class_Window_signal_go_back_requested>`
|
||
|
||
發送返回請求時,在 :ref:`Node.NOTIFICATION_WM_GO_BACK_REQUEST<class_Node_constant_NOTIFICATION_WM_GO_BACK_REQUEST>` 之後發出(例如在 Android 上按下“返回”按鈕)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_mouse_entered:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**mouse_entered**\ (\ ) :ref:`🔗<class_Window_signal_mouse_entered>`
|
||
|
||
當滑鼠遊標進入\ **Window**\ 的可見區域時發出,該區域未被其他\ :ref:`Control<class_Control>`\ 或視窗遮擋,前提是其\ :ref:`Viewport.gui_disable_input<class_Viewport_property_gui_disable_input>`\ 為\ ``false ``\ ,不論目前是否處於焦點狀態。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_mouse_exited:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**mouse_exited**\ (\ ) :ref:`🔗<class_Window_signal_mouse_exited>`
|
||
|
||
當滑鼠遊標離開\ **Window**\ 的可見區域時發出,該區域未被其他\ :ref:`Control<class_Control>`\ 或視窗遮擋,前提是其\ :ref:`Viewport.gui_disable_input<class_Viewport_property_gui_disable_input>`\ 為\ ``false ``\ ,不論目前是否處於焦點狀態。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_nonclient_window_input:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**nonclient_window_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) :ref:`🔗<class_Window_signal_nonclient_window_input>`
|
||
|
||
Emitted when the mouse event is received by the custom decoration area defined by :ref:`nonclient_area<class_Window_property_nonclient_area>`, and normal input to the window is blocked (such as when it has an exclusive child opened). ``event``'s position is in the embedder's coordinate system.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_theme_changed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**theme_changed**\ (\ ) :ref:`🔗<class_Window_signal_theme_changed>`
|
||
|
||
發送 :ref:`NOTIFICATION_THEME_CHANGED<class_Window_constant_NOTIFICATION_THEME_CHANGED>` 通知時發出。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_title_changed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**title_changed**\ (\ ) :ref:`🔗<class_Window_signal_title_changed>`
|
||
|
||
Emitted when window title bar text is changed.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_titlebar_changed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**titlebar_changed**\ (\ ) :ref:`🔗<class_Window_signal_titlebar_changed>`
|
||
|
||
視窗標題列裝飾發生改變時發出,例如 macOS 視窗進入/退出全屏模式,或者“擴充至標題”旗標發生改變。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_visibility_changed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**visibility_changed**\ (\ ) :ref:`🔗<class_Window_signal_visibility_changed>`
|
||
|
||
顯示或隱藏該 **Window** 時發出。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_signal_window_input:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**window_input**\ (\ event\: :ref:`InputEvent<class_InputEvent>`\ ) :ref:`🔗<class_Window_signal_window_input>`
|
||
|
||
該 **Window** 持有焦點並收到任何輸入時發出,會把收到的事件作為參數傳入。該事件如果存在位置屬性,該位置使用嵌入器的坐標系。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
列舉
|
||
----
|
||
|
||
.. _enum_Window_Mode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **Mode**: :ref:`🔗<enum_Window_Mode>`
|
||
|
||
.. _class_Window_constant_MODE_WINDOWED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Mode<enum_Window_Mode>` **MODE_WINDOWED** = ``0``
|
||
|
||
視窗模式,即 **Window** 不佔據整個螢幕(除非設定為螢幕的大小)。
|
||
|
||
.. _class_Window_constant_MODE_MINIMIZED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Mode<enum_Window_Mode>` **MODE_MINIMIZED** = ``1``
|
||
|
||
最小化視窗模式,即 **Window** 在視窗管理器的視窗列表中既不可見也不可用。通常發生在按下最小化按鈕時。
|
||
|
||
.. _class_Window_constant_MODE_MAXIMIZED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Mode<enum_Window_Mode>` **MODE_MAXIMIZED** = ``2``
|
||
|
||
最大化視窗模式,即 **Window** 會佔據整個螢幕區域,工作列除外,並且會顯示邊框。通常發生在按下最大化按鈕時。
|
||
|
||
.. _class_Window_constant_MODE_FULLSCREEN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Mode<enum_Window_Mode>` **MODE_FULLSCREEN** = ``3``
|
||
|
||
Full screen mode with full multi-window support.
|
||
|
||
Full screen window covers the entire display area of a screen and has no decorations. The display's video mode is not changed.
|
||
|
||
\ **On Android:** This enables immersive mode.
|
||
|
||
\ **On macOS:** A new desktop is used to display the running project.
|
||
|
||
\ **Note:** Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports :doc:`multiple resolutions <../tutorials/rendering/multiple_resolutions>` when enabling full screen mode.
|
||
|
||
.. _class_Window_constant_MODE_EXCLUSIVE_FULLSCREEN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Mode<enum_Window_Mode>` **MODE_EXCLUSIVE_FULLSCREEN** = ``4``
|
||
|
||
A single window full screen mode. This mode has less overhead, but only one window can be open on a given screen at a time (opening a child window or application switching will trigger a full screen transition).
|
||
|
||
Full screen window covers the entire display area of a screen and has no border or decorations. The display's video mode is not changed.
|
||
|
||
\ **Note:** This mode might not work with screen recording software.
|
||
|
||
\ **On Android:** This enables immersive mode.
|
||
|
||
\ **On Windows:** Depending on video driver, full screen transition might cause screens to go black for a moment.
|
||
|
||
\ **On macOS:** A new desktop is used to display the running project. Exclusive full screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen.
|
||
|
||
\ **On Linux (X11):** Exclusive full screen mode bypasses compositor.
|
||
|
||
\ **On Linux (Wayland):** Equivalent to :ref:`MODE_FULLSCREEN<class_Window_constant_MODE_FULLSCREEN>`.
|
||
|
||
\ **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 :doc:`multiple resolutions <../tutorials/rendering/multiple_resolutions>` when enabling full screen mode.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Window_Flags:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **Flags**: :ref:`🔗<enum_Window_Flags>`
|
||
|
||
.. _class_Window_constant_FLAG_RESIZE_DISABLED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_RESIZE_DISABLED** = ``0``
|
||
|
||
該視窗不能通過拖動其調整大小的手柄來調整大小。仍然可以使用 :ref:`size<class_Window_property_size>` 來調整視窗的大小。這個旗標對於全屏視窗來說是被忽略的。用 :ref:`unresizable<class_Window_property_unresizable>` 設置。
|
||
|
||
.. _class_Window_constant_FLAG_BORDERLESS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_BORDERLESS** = ``1``
|
||
|
||
該視窗沒有原生標題列和其他裝飾。全屏視窗會忽略該旗標。由 :ref:`borderless<class_Window_property_borderless>` 設定。
|
||
|
||
.. _class_Window_constant_FLAG_ALWAYS_ON_TOP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_ALWAYS_ON_TOP** = ``2``
|
||
|
||
該視窗漂浮在所有其他視窗之上。全屏視窗會忽略該旗標。由 :ref:`always_on_top<class_Window_property_always_on_top>` 設定。
|
||
|
||
.. _class_Window_constant_FLAG_TRANSPARENT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_TRANSPARENT** = ``3``
|
||
|
||
該視窗的背景可以是透明的。使用 :ref:`transparent<class_Window_property_transparent>` 設定。
|
||
|
||
\ **注意:**\ 如果 :ref:`ProjectSettings.display/window/per_pixel_transparency/allowed<class_ProjectSettings_property_display/window/per_pixel_transparency/allowed>` 或該視窗的 :ref:`Viewport.transparent_bg<class_Viewport_property_transparent_bg>` 為 ``false``\ ,則這個旗標無效。
|
||
|
||
.. _class_Window_constant_FLAG_NO_FOCUS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_NO_FOCUS** = ``4``
|
||
|
||
該視窗無法被聚焦。無焦點視窗會忽略除滑鼠點擊之外的所有輸入。由 :ref:`unfocusable<class_Window_property_unfocusable>` 設定。
|
||
|
||
.. _class_Window_constant_FLAG_POPUP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_POPUP** = ``5``
|
||
|
||
視窗為功能表或 :ref:`OptionButton<class_OptionButton>` 下拉式功能表的一部分。視窗可見時無法更改這個旗標。活動的快顯視窗會以獨佔的形式接收所有輸入,但不會從其父視窗竊取焦點。使用者在區域外點擊或切換套用程式時,快顯視窗會自動關閉。快顯視窗必須設定臨時父級(見 :ref:`transient<class_Window_property_transient>`\ )。
|
||
|
||
\ **注意:**\ 這個旗標在嵌入式視窗中無效(除非該視窗是 :ref:`Popup<class_Popup>`\ )。
|
||
|
||
.. _class_Window_constant_FLAG_EXTEND_TO_TITLE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_EXTEND_TO_TITLE** = ``6``
|
||
|
||
視窗內容擴充到視窗的全部尺寸。與無邊框視窗不同,框架保持不變,可以用來調整窗口的大小,標題列是透明的,但有最小/最大/關閉按鈕。用 :ref:`extend_to_title<class_Window_property_extend_to_title>` 設定。
|
||
|
||
\ **注意:**\ 這個旗標在 macOS 上實作。
|
||
|
||
\ **注意:**\ 這個旗標在嵌入式視窗中無效。
|
||
|
||
.. _class_Window_constant_FLAG_MOUSE_PASSTHROUGH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_MOUSE_PASSTHROUGH** = ``7``
|
||
|
||
所有滑鼠事件都被傳遞到同一套用程式的底層視窗。
|
||
|
||
\ **注意:**\ 這個旗標在嵌入式視窗中無效。
|
||
|
||
.. _class_Window_constant_FLAG_SHARP_CORNERS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_SHARP_CORNERS** = ``8``
|
||
|
||
Window style is overridden, forcing sharp corners.
|
||
|
||
\ **Note:** This flag has no effect in embedded windows.
|
||
|
||
\ **Note:** This flag is implemented only on Windows (11).
|
||
|
||
.. _class_Window_constant_FLAG_EXCLUDE_FROM_CAPTURE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_EXCLUDE_FROM_CAPTURE** = ``9``
|
||
|
||
Windows is excluded from screenshots taken by :ref:`DisplayServer.screen_get_image()<class_DisplayServer_method_screen_get_image>`, :ref:`DisplayServer.screen_get_image_rect()<class_DisplayServer_method_screen_get_image_rect>`, and :ref:`DisplayServer.screen_get_pixel()<class_DisplayServer_method_screen_get_pixel>`.
|
||
|
||
\ **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.
|
||
|
||
.. _class_Window_constant_FLAG_POPUP_WM_HINT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_POPUP_WM_HINT** = ``10``
|
||
|
||
Signals the window manager that this window is supposed to be an implementation-defined "popup" (usually a floating, borderless, untileable and immovable child window).
|
||
|
||
.. _class_Window_constant_FLAG_MINIMIZE_DISABLED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_MINIMIZE_DISABLED** = ``11``
|
||
|
||
Window minimize button is disabled.
|
||
|
||
\ **Note:** This flag is implemented on macOS and Windows.
|
||
|
||
.. _class_Window_constant_FLAG_MAXIMIZE_DISABLED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_MAXIMIZE_DISABLED** = ``12``
|
||
|
||
Window maximize button is disabled.
|
||
|
||
\ **Note:** This flag is implemented on macOS and Windows.
|
||
|
||
.. _class_Window_constant_FLAG_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`Flags<enum_Window_Flags>` **FLAG_MAX** = ``13``
|
||
|
||
:ref:`Flags<enum_Window_Flags>` 的最大值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Window_ContentScaleMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **ContentScaleMode**: :ref:`🔗<enum_Window_ContentScaleMode>`
|
||
|
||
.. _class_Window_constant_CONTENT_SCALE_MODE_DISABLED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ContentScaleMode<enum_Window_ContentScaleMode>` **CONTENT_SCALE_MODE_DISABLED** = ``0``
|
||
|
||
不會為了配對 **Window** 的大小而對內容進行縮放。
|
||
|
||
.. _class_Window_constant_CONTENT_SCALE_MODE_CANVAS_ITEMS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ContentScaleMode<enum_Window_ContentScaleMode>` **CONTENT_SCALE_MODE_CANVAS_ITEMS** = ``1``
|
||
|
||
會將內容按照目標大小算繪。比 :ref:`CONTENT_SCALE_MODE_VIEWPORT<class_Window_constant_CONTENT_SCALE_MODE_VIEWPORT>` 更消耗性能,但結果更佳。
|
||
|
||
.. _class_Window_constant_CONTENT_SCALE_MODE_VIEWPORT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ContentScaleMode<enum_Window_ContentScaleMode>` **CONTENT_SCALE_MODE_VIEWPORT** = ``2``
|
||
|
||
會將內容按照原始大小算繪,然後再縮放到目標大小。比 :ref:`CONTENT_SCALE_MODE_CANVAS_ITEMS<class_Window_constant_CONTENT_SCALE_MODE_CANVAS_ITEMS>` 性能更高,但會導致圖像的圖元化。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Window_ContentScaleAspect:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **ContentScaleAspect**: :ref:`🔗<enum_Window_ContentScaleAspect>`
|
||
|
||
.. _class_Window_constant_CONTENT_SCALE_ASPECT_IGNORE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **CONTENT_SCALE_ASPECT_IGNORE** = ``0``
|
||
|
||
會忽略縱橫比。縮放就是簡單地將內容拉伸至目標大小。
|
||
|
||
.. _class_Window_constant_CONTENT_SCALE_ASPECT_KEEP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **CONTENT_SCALE_ASPECT_KEEP** = ``1``
|
||
|
||
會保留內容的縱橫比。如果目標大小與原始大小的縱橫比不同,則會將圖像居中,左右兩側會出現黑條。
|
||
|
||
.. _class_Window_constant_CONTENT_SCALE_ASPECT_KEEP_WIDTH:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **CONTENT_SCALE_ASPECT_KEEP_WIDTH** = ``2``
|
||
|
||
內容可以垂直擴充。橫向縮放時,會保留寬度比,在左右兩側新增黑條。
|
||
|
||
.. _class_Window_constant_CONTENT_SCALE_ASPECT_KEEP_HEIGHT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **CONTENT_SCALE_ASPECT_KEEP_HEIGHT** = ``3``
|
||
|
||
內容可以水平擴充。縱向縮放時,會保留高度比,在上下兩側新增黑條。
|
||
|
||
.. _class_Window_constant_CONTENT_SCALE_ASPECT_EXPAND:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **CONTENT_SCALE_ASPECT_EXPAND** = ``4``
|
||
|
||
會保留內容的縱橫比。如果目標大小與原始大小的縱橫比不同,則內容會保持在左上角,將拉伸出的空間增加為可見區域。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Window_ContentScaleStretch:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **ContentScaleStretch**: :ref:`🔗<enum_Window_ContentScaleStretch>`
|
||
|
||
.. _class_Window_constant_CONTENT_SCALE_STRETCH_FRACTIONAL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ContentScaleStretch<enum_Window_ContentScaleStretch>` **CONTENT_SCALE_STRETCH_FRACTIONAL** = ``0``
|
||
|
||
內容將根據分數因子進行拉伸。這會填充視窗中的所有可用空間,但會由於像素縮放不均勻而導致出現“像素擺動”。
|
||
|
||
.. _class_Window_constant_CONTENT_SCALE_STRETCH_INTEGER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ContentScaleStretch<enum_Window_ContentScaleStretch>` **CONTENT_SCALE_STRETCH_INTEGER** = ``1``
|
||
|
||
內容將僅根據整數因子進行拉伸,保留銳利像素。這可能會在視窗邊緣留下可見的黑色背景,具體取決於視窗大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Window_LayoutDirection:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **LayoutDirection**: :ref:`🔗<enum_Window_LayoutDirection>`
|
||
|
||
.. _class_Window_constant_LAYOUT_DIRECTION_INHERITED:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`LayoutDirection<enum_Window_LayoutDirection>` **LAYOUT_DIRECTION_INHERITED** = ``0``
|
||
|
||
自動佈局方向,由父視窗的佈局方向決定。
|
||
|
||
.. _class_Window_constant_LAYOUT_DIRECTION_APPLICATION_LOCALE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`LayoutDirection<enum_Window_LayoutDirection>` **LAYOUT_DIRECTION_APPLICATION_LOCALE** = ``1``
|
||
|
||
自動佈局方向,根據目前語言環境確定。
|
||
|
||
.. _class_Window_constant_LAYOUT_DIRECTION_LTR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`LayoutDirection<enum_Window_LayoutDirection>` **LAYOUT_DIRECTION_LTR** = ``2``
|
||
|
||
從左至右的佈局方向。
|
||
|
||
.. _class_Window_constant_LAYOUT_DIRECTION_RTL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`LayoutDirection<enum_Window_LayoutDirection>` **LAYOUT_DIRECTION_RTL** = ``3``
|
||
|
||
從右至左的佈局方向。
|
||
|
||
.. _class_Window_constant_LAYOUT_DIRECTION_SYSTEM_LOCALE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`LayoutDirection<enum_Window_LayoutDirection>` **LAYOUT_DIRECTION_SYSTEM_LOCALE** = ``4``
|
||
|
||
Automatic layout direction, determined from the system locale.
|
||
|
||
.. _class_Window_constant_LAYOUT_DIRECTION_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`LayoutDirection<enum_Window_LayoutDirection>` **LAYOUT_DIRECTION_MAX** = ``5``
|
||
|
||
Represents the size of the :ref:`LayoutDirection<enum_Window_LayoutDirection>` enum.
|
||
|
||
.. _class_Window_constant_LAYOUT_DIRECTION_LOCALE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`LayoutDirection<enum_Window_LayoutDirection>` **LAYOUT_DIRECTION_LOCALE** = ``1``
|
||
|
||
**已棄用:** Use :ref:`LAYOUT_DIRECTION_APPLICATION_LOCALE<class_Window_constant_LAYOUT_DIRECTION_APPLICATION_LOCALE>` instead.
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Window_WindowInitialPosition:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **WindowInitialPosition**: :ref:`🔗<enum_Window_WindowInitialPosition>`
|
||
|
||
.. _class_Window_constant_WINDOW_INITIAL_POSITION_ABSOLUTE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **WINDOW_INITIAL_POSITION_ABSOLUTE** = ``0``
|
||
|
||
初始視窗位置由 :ref:`position<class_Window_property_position>` 決定。
|
||
|
||
.. _class_Window_constant_WINDOW_INITIAL_POSITION_CENTER_PRIMARY_SCREEN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **WINDOW_INITIAL_POSITION_CENTER_PRIMARY_SCREEN** = ``1``
|
||
|
||
初始視窗位置為主螢幕的中心。
|
||
|
||
.. _class_Window_constant_WINDOW_INITIAL_POSITION_CENTER_MAIN_WINDOW_SCREEN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **WINDOW_INITIAL_POSITION_CENTER_MAIN_WINDOW_SCREEN** = ``2``
|
||
|
||
初始視窗位置為主視窗螢幕的中心。
|
||
|
||
.. _class_Window_constant_WINDOW_INITIAL_POSITION_CENTER_OTHER_SCREEN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **WINDOW_INITIAL_POSITION_CENTER_OTHER_SCREEN** = ``3``
|
||
|
||
初始視窗位置為 :ref:`current_screen<class_Window_property_current_screen>` 螢幕的中心。
|
||
|
||
.. _class_Window_constant_WINDOW_INITIAL_POSITION_CENTER_SCREEN_WITH_MOUSE_FOCUS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **WINDOW_INITIAL_POSITION_CENTER_SCREEN_WITH_MOUSE_FOCUS** = ``4``
|
||
|
||
初始視窗位置為滑鼠指標所在螢幕的中心。
|
||
|
||
.. _class_Window_constant_WINDOW_INITIAL_POSITION_CENTER_SCREEN_WITH_KEYBOARD_FOCUS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **WINDOW_INITIAL_POSITION_CENTER_SCREEN_WITH_KEYBOARD_FOCUS** = ``5``
|
||
|
||
初始視窗位置為鍵盤聚焦的視窗所在螢幕的中心。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
常數
|
||
----
|
||
|
||
.. _class_Window_constant_NOTIFICATION_VISIBILITY_CHANGED:
|
||
|
||
.. rst-class:: classref-constant
|
||
|
||
**NOTIFICATION_VISIBILITY_CHANGED** = ``30`` :ref:`🔗<class_Window_constant_NOTIFICATION_VISIBILITY_CHANGED>`
|
||
|
||
該 **Window** 的可見性發生改變時,在 :ref:`visibility_changed<class_Window_signal_visibility_changed>` 之前發出。
|
||
|
||
.. _class_Window_constant_NOTIFICATION_THEME_CHANGED:
|
||
|
||
.. rst-class:: classref-constant
|
||
|
||
**NOTIFICATION_THEME_CHANGED** = ``32`` :ref:`🔗<class_Window_constant_NOTIFICATION_THEME_CHANGED>`
|
||
|
||
當節點需要更新其主題項時發送。以下任意情況都會觸發:
|
||
|
||
- 此節點或其任何祖先節點更改了 :ref:`theme<class_Window_property_theme>` 屬性。
|
||
|
||
- 此節點更改了 :ref:`theme_type_variation<class_Window_property_theme_type_variation>` 屬性。
|
||
|
||
- 節點進入場景樹。
|
||
|
||
\ **注意:**\ 為了優化性能,此節點在場景樹之外發生更改時不會發送此通知。取而代之的是,當節點進入場景樹時會均勻套用所有主題項的更新。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
屬性說明
|
||
--------
|
||
|
||
.. _class_Window_property_accessibility_description:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **accessibility_description** = ``""`` :ref:`🔗<class_Window_property_accessibility_description>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_accessibility_description**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_accessibility_description**\ (\ )
|
||
|
||
The human-readable node description that is reported to assistive apps.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_accessibility_name:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **accessibility_name** = ``""`` :ref:`🔗<class_Window_property_accessibility_name>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_accessibility_name**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_accessibility_name**\ (\ )
|
||
|
||
The human-readable node name that is reported to assistive apps.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_always_on_top:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **always_on_top** = ``false`` :ref:`🔗<class_Window_property_always_on_top>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const|
|
||
|
||
如果為 ``true``\ ,則該視窗將位於所有其他視窗的頂部。如果啟用了 :ref:`transient<class_Window_property_transient>` 則不起作用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_auto_translate:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **auto_translate** :ref:`🔗<class_Window_property_auto_translate>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_auto_translate**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_auto_translating**\ (\ )
|
||
|
||
**已棄用:** Use :ref:`Node.auto_translate_mode<class_Node_property_auto_translate_mode>` and :ref:`Node.can_auto_translate()<class_Node_method_can_auto_translate>` instead.
|
||
|
||
切換是否所有文字都應該根據目前區域設定自動變為翻譯後的版本。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_borderless:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **borderless** = ``false`` :ref:`🔗<class_Window_property_borderless>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const|
|
||
|
||
如果為 ``true``\ ,則該視窗將沒有邊框。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_content_scale_aspect:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **content_scale_aspect** = ``0`` :ref:`🔗<class_Window_property_content_scale_aspect>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_content_scale_aspect**\ (\ value\: :ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>`\ )
|
||
- :ref:`ContentScaleAspect<enum_Window_ContentScaleAspect>` **get_content_scale_aspect**\ (\ )
|
||
|
||
指定當 **Window** 的大小改變時,內容縱橫比的行為。基礎縱橫比由 :ref:`content_scale_size<class_Window_property_content_scale_size>` 決定。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_content_scale_factor:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **content_scale_factor** = ``1.0`` :ref:`🔗<class_Window_property_content_scale_factor>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_content_scale_factor**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_content_scale_factor**\ (\ )
|
||
|
||
Specifies the base scale of **Window**'s content when its :ref:`size<class_Window_property_size>` is equal to :ref:`content_scale_size<class_Window_property_content_scale_size>`. See also :ref:`Viewport.get_stretch_transform()<class_Viewport_method_get_stretch_transform>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_content_scale_mode:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`ContentScaleMode<enum_Window_ContentScaleMode>` **content_scale_mode** = ``0`` :ref:`🔗<class_Window_property_content_scale_mode>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_content_scale_mode**\ (\ value\: :ref:`ContentScaleMode<enum_Window_ContentScaleMode>`\ )
|
||
- :ref:`ContentScaleMode<enum_Window_ContentScaleMode>` **get_content_scale_mode**\ (\ )
|
||
|
||
指定當 **Window** 的大小改變時,如何對內容進行縮放。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_content_scale_size:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Vector2i<class_Vector2i>` **content_scale_size** = ``Vector2i(0, 0)`` :ref:`🔗<class_Window_property_content_scale_size>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_content_scale_size**\ (\ value\: :ref:`Vector2i<class_Vector2i>`\ )
|
||
- :ref:`Vector2i<class_Vector2i>` **get_content_scale_size**\ (\ )
|
||
|
||
內容的基礎大小(內容指在視窗內繪製的節點)。如果非零,當視窗大小發生變化時,\ **Window** 的內容將被縮放。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_content_scale_stretch:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`ContentScaleStretch<enum_Window_ContentScaleStretch>` **content_scale_stretch** = ``0`` :ref:`🔗<class_Window_property_content_scale_stretch>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_content_scale_stretch**\ (\ value\: :ref:`ContentScaleStretch<enum_Window_ContentScaleStretch>`\ )
|
||
- :ref:`ContentScaleStretch<enum_Window_ContentScaleStretch>` **get_content_scale_stretch**\ (\ )
|
||
|
||
用於確定 2D 元素的最終比例因子的策略。除了由 :ref:`content_scale_size<class_Window_property_content_scale_size>` 確定的自動比例因子之外,這還會影響 :ref:`content_scale_factor<class_Window_property_content_scale_factor>` 的應用方式。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_current_screen:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`int<class_int>` **current_screen** :ref:`🔗<class_Window_property_current_screen>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_current_screen**\ (\ value\: :ref:`int<class_int>`\ )
|
||
- :ref:`int<class_int>` **get_current_screen**\ (\ )
|
||
|
||
該視窗目前所在的螢幕。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_exclude_from_capture:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **exclude_from_capture** = ``false`` :ref:`🔗<class_Window_property_exclude_from_capture>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const|
|
||
|
||
If ``true``, the **Window** is excluded from screenshots taken by :ref:`DisplayServer.screen_get_image()<class_DisplayServer_method_screen_get_image>`, :ref:`DisplayServer.screen_get_image_rect()<class_DisplayServer_method_screen_get_image_rect>`, and :ref:`DisplayServer.screen_get_pixel()<class_DisplayServer_method_screen_get_pixel>`.
|
||
|
||
\ **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.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_exclusive:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **exclusive** = ``false`` :ref:`🔗<class_Window_property_exclusive>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_exclusive**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_exclusive**\ (\ )
|
||
|
||
如果為 ``true``\ ,則 **Window** 將處於獨佔模式。獨佔視窗總是在其父視窗的頂部,會阻止所有輸入到達父級 **Window**\ 。
|
||
|
||
需要啟用 :ref:`transient<class_Window_property_transient>` 才能正常工作。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_extend_to_title:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **extend_to_title** = ``false`` :ref:`🔗<class_Window_property_extend_to_title>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const|
|
||
|
||
如果為 ``true``\ ,則 **Window** 的內容將會擴充到視窗的完整大小,視窗標題欄是透明的。
|
||
|
||
\ **注意:**\ 這個屬性僅在 macOS 上實作。
|
||
|
||
\ **注意:**\ 這個屬性僅對原生視窗有效。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_force_native:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **force_native** = ``false`` :ref:`🔗<class_Window_property_force_native>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_force_native**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_force_native**\ (\ )
|
||
|
||
If ``true``, native window will be used regardless of parent viewport and project settings.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_initial_position:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **initial_position** = ``0`` :ref:`🔗<class_Window_property_initial_position>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_initial_position**\ (\ value\: :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>`\ )
|
||
- :ref:`WindowInitialPosition<enum_Window_WindowInitialPosition>` **get_initial_position**\ (\ )
|
||
|
||
Specifies the initial type of position for the **Window**.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_keep_title_visible:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **keep_title_visible** = ``false`` :ref:`🔗<class_Window_property_keep_title_visible>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_keep_title_visible**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_keep_title_visible**\ (\ )
|
||
|
||
If ``true``, the **Window** width is expanded to keep the title bar text fully visible.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_max_size:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Vector2i<class_Vector2i>` **max_size** = ``Vector2i(0, 0)`` :ref:`🔗<class_Window_property_max_size>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_max_size**\ (\ value\: :ref:`Vector2i<class_Vector2i>`\ )
|
||
- :ref:`Vector2i<class_Vector2i>` **get_max_size**\ (\ )
|
||
|
||
如果非零,則調整該 **Window** 的大小時無法大於該尺寸。
|
||
|
||
\ **注意:**\ 如果值小於 :ref:`min_size<class_Window_property_min_size>`\ ,該屬性將被忽略。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_maximize_disabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **maximize_disabled** = ``false`` :ref:`🔗<class_Window_property_maximize_disabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const|
|
||
|
||
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.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_min_size:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Vector2i<class_Vector2i>` **min_size** = ``Vector2i(0, 0)`` :ref:`🔗<class_Window_property_min_size>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_min_size**\ (\ value\: :ref:`Vector2i<class_Vector2i>`\ )
|
||
- :ref:`Vector2i<class_Vector2i>` **get_min_size**\ (\ )
|
||
|
||
如果非零,則調整該 **Window** 的大小時無法小於該尺寸。
|
||
|
||
\ **注意:**\ 如果啟用了 :ref:`wrap_controls<class_Window_property_wrap_controls>` 並且 :ref:`get_contents_minimum_size()<class_Window_method_get_contents_minimum_size>` 更大,則此屬性將被忽略。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_minimize_disabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **minimize_disabled** = ``false`` :ref:`🔗<class_Window_property_minimize_disabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const|
|
||
|
||
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.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_mode:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Mode<enum_Window_Mode>` **mode** = ``0`` :ref:`🔗<class_Window_property_mode>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_mode**\ (\ value\: :ref:`Mode<enum_Window_Mode>`\ )
|
||
- :ref:`Mode<enum_Window_Mode>` **get_mode**\ (\ )
|
||
|
||
設定該視窗的目前模式。
|
||
|
||
\ **注意:**\ 在 Windows 和 Linux 上,全屏與獨佔全屏是不同的模式。
|
||
|
||
\ **注意:**\ 這個方法僅對原生視窗有效,即主視窗和禁用主視口 :ref:`Viewport.gui_embed_subwindows<class_Viewport_property_gui_embed_subwindows>` 時的 **Window** 衍生節點。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_mouse_passthrough:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **mouse_passthrough** = ``false`` :ref:`🔗<class_Window_property_mouse_passthrough>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const|
|
||
|
||
如果為 ``true``\ ,則所有滑鼠事件都會傳遞給同一套用的底層視窗。另見 :ref:`mouse_passthrough_polygon<class_Window_property_mouse_passthrough_polygon>`\ 。
|
||
|
||
\ **注意:**\ 這個屬性在 Linux(X11)、macOS 和 Windows 上實作。
|
||
|
||
\ **注意:**\ 這個屬性僅對原生視窗有效。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_mouse_passthrough_polygon:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`PackedVector2Array<class_PackedVector2Array>` **mouse_passthrough_polygon** = ``PackedVector2Array()`` :ref:`🔗<class_Window_property_mouse_passthrough_polygon>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_mouse_passthrough_polygon**\ (\ value\: :ref:`PackedVector2Array<class_PackedVector2Array>`\ )
|
||
- :ref:`PackedVector2Array<class_PackedVector2Array>` **get_mouse_passthrough_polygon**\ (\ )
|
||
|
||
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).
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
# Set region, using Path2D node.
|
||
$Window.mouse_passthrough_polygon = $Path2D.curve.get_baked_points()
|
||
|
||
# Set region, using Polygon2D node.
|
||
$Window.mouse_passthrough_polygon = $Polygon2D.polygon
|
||
|
||
# Reset region to default.
|
||
$Window.mouse_passthrough_polygon = []
|
||
|
||
.. code-tab:: csharp
|
||
|
||
// Set region, using Path2D node.
|
||
GetNode<Window>("Window").MousePassthroughPolygon = GetNode<Path2D>("Path2D").Curve.GetBakedPoints();
|
||
|
||
// Set region, using Polygon2D node.
|
||
GetNode<Window>("Window").MousePassthroughPolygon = GetNode<Polygon2D>("Polygon2D").Polygon;
|
||
|
||
// Reset region to default.
|
||
GetNode<Window>("Window").MousePassthroughPolygon = [];
|
||
|
||
|
||
|
||
\ **Note:** This property is ignored if :ref:`mouse_passthrough<class_Window_property_mouse_passthrough>` 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.
|
||
|
||
**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedVector2Array<class_PackedVector2Array>` for more details.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_nonclient_area:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Rect2i<class_Rect2i>` **nonclient_area** = ``Rect2i(0, 0, 0, 0)`` :ref:`🔗<class_Window_property_nonclient_area>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_nonclient_area**\ (\ value\: :ref:`Rect2i<class_Rect2i>`\ )
|
||
- :ref:`Rect2i<class_Rect2i>` **get_nonclient_area**\ (\ )
|
||
|
||
If set, defines the window's custom decoration area which will receive mouse input, even if normal input to the window is blocked (such as when it has an exclusive child opened). See also :ref:`nonclient_window_input<class_Window_signal_nonclient_window_input>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_popup_window:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **popup_window** = ``false`` :ref:`🔗<class_Window_property_popup_window>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const|
|
||
|
||
如果為 ``true``\ ,則該 **Window** 將被視為快顯視窗。快顯視窗是子視窗,不會在系統視窗管理器的視窗列表中顯示為單獨的視窗,並且會在按一下它們之外的任何位置時發送關閉請求(除非啟用了 :ref:`exclusive<class_Window_property_exclusive>`\ )。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_popup_wm_hint:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **popup_wm_hint** = ``false`` :ref:`🔗<class_Window_property_popup_wm_hint>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const|
|
||
|
||
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).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_position:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Vector2i<class_Vector2i>` **position** = ``Vector2i(0, 0)`` :ref:`🔗<class_Window_property_position>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_position**\ (\ value\: :ref:`Vector2i<class_Vector2i>`\ )
|
||
- :ref:`Vector2i<class_Vector2i>` **get_position**\ (\ )
|
||
|
||
該視窗的位置,單位為圖元。
|
||
|
||
如果 :ref:`ProjectSettings.display/window/subwindows/embed_subwindows<class_ProjectSettings_property_display/window/subwindows/embed_subwindows>` 為 ``false``\ ,則該位置使用螢幕絕對座標。通常適用於編輯器外掛程式。如果該設置項為 ``true``\ ,則該視窗的位置使用其父 :ref:`Viewport<class_Viewport>` 中的座標。
|
||
|
||
\ **注意:**\ 這個屬性僅在 :ref:`initial_position<class_Window_property_initial_position>` 為 :ref:`WINDOW_INITIAL_POSITION_ABSOLUTE<class_Window_constant_WINDOW_INITIAL_POSITION_ABSOLUTE>` 時有效。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_sharp_corners:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **sharp_corners** = ``false`` :ref:`🔗<class_Window_property_sharp_corners>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const|
|
||
|
||
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.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_size:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Vector2i<class_Vector2i>` **size** = ``Vector2i(100, 100)`` :ref:`🔗<class_Window_property_size>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_size**\ (\ value\: :ref:`Vector2i<class_Vector2i>`\ )
|
||
- :ref:`Vector2i<class_Vector2i>` **get_size**\ (\ )
|
||
|
||
該視窗的大小,單位為圖元。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_theme:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Theme<class_Theme>` **theme** :ref:`🔗<class_Window_property_theme>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_theme**\ (\ value\: :ref:`Theme<class_Theme>`\ )
|
||
- :ref:`Theme<class_Theme>` **get_theme**\ (\ )
|
||
|
||
該節點及其子 :ref:`Control<class_Control>` 和 **Window** 所使用的 :ref:`Theme<class_Theme>` 資源。如果子節點也設定了 :ref:`Theme<class_Theme>` 資源,則會合並主題項,子節點的定義優先順序更高。
|
||
|
||
\ **注意:**\ 除非 **Window** 為嵌入式,否則視窗樣式無效。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_theme_type_variation:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`StringName<class_StringName>` **theme_type_variation** = ``&""`` :ref:`🔗<class_Window_property_theme_type_variation>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_theme_type_variation**\ (\ value\: :ref:`StringName<class_StringName>`\ )
|
||
- :ref:`StringName<class_StringName>` **get_theme_type_variation**\ (\ )
|
||
|
||
此 **Window** 用於搜尋其自己的主題專案的主題型別變體的名稱。詳情見 :ref:`Control.theme_type_variation<class_Control_property_theme_type_variation>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_title:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **title** = ``""`` :ref:`🔗<class_Window_property_title>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_title**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_title**\ (\ )
|
||
|
||
該視窗的標題。如果 **Window** 是原生的,則 :ref:`Theme<class_Theme>` 中設定的標題樣式無效。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_transient:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **transient** = ``false`` :ref:`🔗<class_Window_property_transient>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_transient**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_transient**\ (\ )
|
||
|
||
如果為 ``true`` 則該 **Window** 是臨時視窗,即會被認為是另一個 **Window** 的子級。臨時視窗會和臨時父級一起銷毀,關閉時會將焦點返還給父級。臨時視窗顯示在非獨占全屏父視窗之上。臨時視窗無法進入全屏模式。
|
||
|
||
請注意,不同平臺可能由不同的行為。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_transient_to_focused:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **transient_to_focused** = ``false`` :ref:`🔗<class_Window_property_transient_to_focused>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_transient_to_focused**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_transient_to_focused**\ (\ )
|
||
|
||
If ``true``, and the **Window** is :ref:`transient<class_Window_property_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.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_transparent:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **transparent** = ``false`` :ref:`🔗<class_Window_property_transparent>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const|
|
||
|
||
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 :ref:`ProjectSettings.display/window/per_pixel_transparency/allowed<class_ProjectSettings_property_display/window/per_pixel_transparency/allowed>` is set to ``false``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_unfocusable:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **unfocusable** = ``false`` :ref:`🔗<class_Window_property_unfocusable>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const|
|
||
|
||
如果為 ``true``\ ,則該 **Window** 既無法聚焦也無法互動,但仍然可見。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_unresizable:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **unresizable** = ``false`` :ref:`🔗<class_Window_property_unresizable>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const|
|
||
|
||
If ``true``, the window can't be resized.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_visible:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **visible** = ``true`` :ref:`🔗<class_Window_property_visible>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_visible**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_visible**\ (\ )
|
||
|
||
如果為 ``true``\ ,則該視窗可見。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_property_wrap_controls:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **wrap_controls** = ``false`` :ref:`🔗<class_Window_property_wrap_controls>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_wrap_controls**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_wrapping_controls**\ (\ )
|
||
|
||
如果為 ``true``\ ,則新增或刪除子節點時,視窗的大小會自動更新,新的大小更大時會忽略 :ref:`min_size<class_Window_property_min_size>`\ 。
|
||
|
||
如果為 ``false``\ ,則需要手動呼叫 :ref:`child_controls_changed()<class_Window_method_child_controls_changed>`\ 。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
方法說明
|
||
--------
|
||
|
||
.. _class_Window_private_method__get_contents_minimum_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector2<class_Vector2>` **_get_contents_minimum_size**\ (\ ) |virtual| |const| :ref:`🔗<class_Window_private_method__get_contents_minimum_size>`
|
||
|
||
可以被使用者重寫的虛方法。在匯出完成後被呼叫。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_add_theme_color_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_theme_color_override**\ (\ name\: :ref:`StringName<class_StringName>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Window_method_add_theme_color_override>`
|
||
|
||
為名為 ``name`` 的主題 :ref:`Color<class_Color>` 建立本地覆蓋項。為控制項獲取主題時,本地覆蓋項始終優先。覆蓋項可以使用 :ref:`remove_theme_color_override()<class_Window_method_remove_theme_color_override>` 移除。
|
||
|
||
詳情請參閱 :ref:`get_theme_color()<class_Window_method_get_theme_color>` 和 :ref:`Control.add_theme_color_override()<class_Control_method_add_theme_color_override>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_add_theme_constant_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_theme_constant_override**\ (\ name\: :ref:`StringName<class_StringName>`, constant\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Window_method_add_theme_constant_override>`
|
||
|
||
為名稱為 ``name`` 的主題常數建立本地覆蓋項。為控制項獲取主題專案時,本地覆蓋項始終優先。覆蓋項可以使用 :ref:`remove_theme_constant_override()<class_Window_method_remove_theme_constant_override>` 移除。
|
||
|
||
另見 :ref:`get_theme_constant()<class_Window_method_get_theme_constant>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_add_theme_font_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_theme_font_override**\ (\ name\: :ref:`StringName<class_StringName>`, font\: :ref:`Font<class_Font>`\ ) :ref:`🔗<class_Window_method_add_theme_font_override>`
|
||
|
||
為名稱為 ``name`` 的主題 :ref:`Font<class_Font>` 建立本地覆蓋項。為控制項獲取主題專案時,本地覆蓋項始終優先。覆蓋項可以使用 :ref:`remove_theme_font_override()<class_Window_method_remove_theme_font_override>` 移除。
|
||
|
||
另見 :ref:`get_theme_font()<class_Window_method_get_theme_font>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_add_theme_font_size_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_theme_font_size_override**\ (\ name\: :ref:`StringName<class_StringName>`, font_size\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Window_method_add_theme_font_size_override>`
|
||
|
||
為名稱為 ``name`` 的主題字形大小建立本地覆蓋項。為控制項獲取主題專案時,本地覆蓋項始終優先。覆蓋項可以使用 :ref:`remove_theme_font_size_override()<class_Window_method_remove_theme_font_size_override>` 移除。
|
||
|
||
另見 :ref:`get_theme_font_size()<class_Window_method_get_theme_font_size>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_add_theme_icon_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_theme_icon_override**\ (\ name\: :ref:`StringName<class_StringName>`, texture\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`🔗<class_Window_method_add_theme_icon_override>`
|
||
|
||
為名稱為 ``name`` 的主題圖示建立本地覆蓋項。為控制項獲取主題專案時,本地覆蓋項始終優先。覆蓋項可以使用 :ref:`remove_theme_icon_override()<class_Window_method_remove_theme_icon_override>` 移除。
|
||
|
||
另見 :ref:`get_theme_icon()<class_Window_method_get_theme_icon>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_add_theme_stylebox_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_theme_stylebox_override**\ (\ name\: :ref:`StringName<class_StringName>`, stylebox\: :ref:`StyleBox<class_StyleBox>`\ ) :ref:`🔗<class_Window_method_add_theme_stylebox_override>`
|
||
|
||
為名為 ``name`` 的主題 :ref:`StyleBox<class_StyleBox>` 建立本地覆蓋項。為控制項獲取主題時,本地覆蓋項始終優先。覆蓋項可以使用 :ref:`remove_theme_stylebox_override()<class_Window_method_remove_theme_stylebox_override>` 移除。
|
||
|
||
詳情請參閱 :ref:`get_theme_stylebox()<class_Window_method_get_theme_stylebox>` 和 :ref:`Control.add_theme_stylebox_override()<class_Control_method_add_theme_stylebox_override>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_begin_bulk_theme_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **begin_bulk_theme_override**\ (\ ) :ref:`🔗<class_Window_method_begin_bulk_theme_override>`
|
||
|
||
防止 ``*_theme_*_override`` 方法發出 :ref:`NOTIFICATION_THEME_CHANGED<class_Window_constant_NOTIFICATION_THEME_CHANGED>`\ ,直到 :ref:`end_bulk_theme_override()<class_Window_method_end_bulk_theme_override>` 被呼叫。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_can_draw:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **can_draw**\ (\ ) |const| :ref:`🔗<class_Window_method_can_draw>`
|
||
|
||
返回該視窗是否正在被繪製到螢幕上。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_child_controls_changed:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **child_controls_changed**\ (\ ) :ref:`🔗<class_Window_method_child_controls_changed>`
|
||
|
||
請求更新 **Window** 大小以適應底層 :ref:`Control<class_Control>` 節點。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_end_bulk_theme_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **end_bulk_theme_override**\ (\ ) :ref:`🔗<class_Window_method_end_bulk_theme_override>`
|
||
|
||
結束批量主題覆蓋更新。見 :ref:`begin_bulk_theme_override()<class_Window_method_begin_bulk_theme_override>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_contents_minimum_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector2<class_Vector2>` **get_contents_minimum_size**\ (\ ) |const| :ref:`🔗<class_Window_method_get_contents_minimum_size>`
|
||
|
||
Returns the combined minimum size from the child :ref:`Control<class_Control>` nodes of the window. Use :ref:`child_controls_changed()<class_Window_method_child_controls_changed>` to update it when child nodes have changed.
|
||
|
||
The value returned by this method can be overridden with :ref:`_get_contents_minimum_size()<class_Window_private_method__get_contents_minimum_size>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_flag:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`\ ) |const| :ref:`🔗<class_Window_method_get_flag>`
|
||
|
||
如果設定了旗標 ``flag``\ ,則返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_focused_window:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Window<class_Window>` **get_focused_window**\ (\ ) |static| :ref:`🔗<class_Window_method_get_focused_window>`
|
||
|
||
Returns the focused window.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_layout_direction:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`LayoutDirection<enum_Window_LayoutDirection>` **get_layout_direction**\ (\ ) |const| :ref:`🔗<class_Window_method_get_layout_direction>`
|
||
|
||
返回排版方向和文字書寫方向。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_position_with_decorations:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector2i<class_Vector2i>` **get_position_with_decorations**\ (\ ) |const| :ref:`🔗<class_Window_method_get_position_with_decorations>`
|
||
|
||
Returns the window's position including its border.
|
||
|
||
\ **Note:** If :ref:`visible<class_Window_property_visible>` is ``false``, this method returns the same value as :ref:`position<class_Window_property_position>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_size_with_decorations:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector2i<class_Vector2i>` **get_size_with_decorations**\ (\ ) |const| :ref:`🔗<class_Window_method_get_size_with_decorations>`
|
||
|
||
Returns the window's size including its border.
|
||
|
||
\ **Note:** If :ref:`visible<class_Window_property_visible>` is ``false``, this method returns the same value as :ref:`size<class_Window_property_size>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_theme_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_theme_color**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_Window_method_get_theme_color>`
|
||
|
||
從樹中第一個配對的 :ref:`Theme<class_Theme>` 中返回 :ref:`Color<class_Color>`\ ,該 :ref:`Theme<class_Theme>` 中需要有名稱為 ``name`` 型別為 ``theme_type`` 的顏色專案。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_theme_constant:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_theme_constant**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_Window_method_get_theme_constant>`
|
||
|
||
從樹中第一個配對的 :ref:`Theme<class_Theme>` 中返回常數,該 :ref:`Theme<class_Theme>` 中需要有名稱為 ``name`` 型別為 ``theme_type`` 的常數專案。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_theme_default_base_scale:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **get_theme_default_base_scale**\ (\ ) |const| :ref:`🔗<class_Window_method_get_theme_default_base_scale>`
|
||
|
||
從樹中第一個配對的 :ref:`Theme<class_Theme>` 中返回預設基礎縮放,該 :ref:`Theme<class_Theme>` 中需要具有有效的 :ref:`Theme.default_base_scale<class_Theme_property_default_base_scale>` 值。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_theme_default_font:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Font<class_Font>` **get_theme_default_font**\ (\ ) |const| :ref:`🔗<class_Window_method_get_theme_default_font>`
|
||
|
||
從樹中第一個配對的 :ref:`Theme<class_Theme>` 中返回預設字形,該 :ref:`Theme<class_Theme>` 中需要具有有效的 :ref:`Theme.default_font<class_Theme_property_default_font>` 值。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_theme_default_font_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_theme_default_font_size**\ (\ ) |const| :ref:`🔗<class_Window_method_get_theme_default_font_size>`
|
||
|
||
從樹中第一個配對的 :ref:`Theme<class_Theme>` 中返回預設字形大小,該 :ref:`Theme<class_Theme>` 中需要具有有效的 :ref:`Theme.default_font_size<class_Theme_property_default_font_size>` 值。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_theme_font:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Font<class_Font>` **get_theme_font**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_Window_method_get_theme_font>`
|
||
|
||
從樹中第一個配對的 :ref:`Theme<class_Theme>` 中返回 :ref:`Font<class_Font>`\ ,該 :ref:`Theme<class_Theme>` 中需要有名稱為 ``name`` 型別為 ``theme_type`` 的字形專案。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_theme_font_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_theme_font_size**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_Window_method_get_theme_font_size>`
|
||
|
||
從樹中第一個配對的 :ref:`Theme<class_Theme>` 中返回字形大小,該 :ref:`Theme<class_Theme>` 中需要有名稱為 ``name`` 型別為 ``theme_type`` 的字形大小專案。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_theme_icon:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **get_theme_icon**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_Window_method_get_theme_icon>`
|
||
|
||
從樹中第一個配對的 :ref:`Theme<class_Theme>` 中返回圖示,該 :ref:`Theme<class_Theme>` 中需要有名稱為 ``name`` 型別為 ``theme_type`` 的圖示專案。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_theme_stylebox:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **get_theme_stylebox**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_Window_method_get_theme_stylebox>`
|
||
|
||
從樹中第一個配對的 :ref:`Theme<class_Theme>` 中返回 :ref:`StyleBox<class_StyleBox>`\ ,該 :ref:`Theme<class_Theme>` 中需要有名稱為 ``name`` 型別為 ``theme_type`` 的樣式盒專案。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_get_window_id:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_window_id**\ (\ ) |const| :ref:`🔗<class_Window_method_get_window_id>`
|
||
|
||
返回該視窗的 ID。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_grab_focus:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **grab_focus**\ (\ ) :ref:`🔗<class_Window_method_grab_focus>`
|
||
|
||
使該視窗獲得焦點,從而接收使用者輸入。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_has_focus:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_focus**\ (\ ) |const| :ref:`🔗<class_Window_method_has_focus>`
|
||
|
||
如果該視窗已獲得焦點,則返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_has_theme_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_theme_color**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_Window_method_has_theme_color>`
|
||
|
||
如果樹中存在配對的 :ref:`Theme<class_Theme>`\ ,具有指定名稱 ``name`` 和主題型別 ``theme_type`` 的顏色項,則返回 ``true``\ 。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_has_theme_color_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_theme_color_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Window_method_has_theme_color_override>`
|
||
|
||
如果該 :ref:`Control<class_Control>` 節點中存在名為指定 ``name`` 的主題 :ref:`Color<class_Color>` 本地覆蓋項,則返回 ``true``\ 。
|
||
|
||
詳情請參閱 :ref:`add_theme_color_override()<class_Window_method_add_theme_color_override>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_has_theme_constant:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_theme_constant**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_Window_method_has_theme_constant>`
|
||
|
||
如果樹中存在配對的 :ref:`Theme<class_Theme>`\ ,具有指定名稱 ``name`` 和主題型別 ``theme_type`` 的常數項,則返回 ``true``\ 。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_has_theme_constant_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_theme_constant_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Window_method_has_theme_constant_override>`
|
||
|
||
如果該 :ref:`Control<class_Control>` 節點中存在名為指定 ``name`` 的主題常數本地覆蓋項,則返回 ``true``\ 。
|
||
|
||
詳情請參閱 :ref:`add_theme_constant_override()<class_Window_method_add_theme_constant_override>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_has_theme_font:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_theme_font**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_Window_method_has_theme_font>`
|
||
|
||
如果樹中存在配對的 :ref:`Theme<class_Theme>`\ ,具有指定名稱 ``name`` 和主題型別 ``theme_type`` 的字形項,則返回 ``true``\ 。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_has_theme_font_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_theme_font_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Window_method_has_theme_font_override>`
|
||
|
||
如果該 :ref:`Control<class_Control>` 節點中存在名為指定 ``name`` 的主題 :ref:`Font<class_Font>` 本地覆蓋項,則返回 ``true``\ 。
|
||
|
||
詳情請參閱 :ref:`add_theme_font_override()<class_Window_method_add_theme_font_override>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_has_theme_font_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_theme_font_size**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_Window_method_has_theme_font_size>`
|
||
|
||
如果樹中存在配對的 :ref:`Theme<class_Theme>`\ ,具有指定名稱 ``name`` 和主題型別 ``theme_type`` 的字形大小項,則返回 ``true``\ 。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_has_theme_font_size_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_theme_font_size_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Window_method_has_theme_font_size_override>`
|
||
|
||
如果該 :ref:`Control<class_Control>` 節點中存在名為指定 ``name`` 的主題字形大小本地覆蓋項,則返回 ``true``\ 。
|
||
|
||
詳情請參閱 :ref:`add_theme_font_size_override()<class_Window_method_add_theme_font_size_override>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_has_theme_icon:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_theme_icon**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_Window_method_has_theme_icon>`
|
||
|
||
如果樹中存在配對的 :ref:`Theme<class_Theme>`\ ,具有指定名稱 ``name`` 和主題型別 ``theme_type`` 的圖示項,則返回 ``true``\ 。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_has_theme_icon_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_theme_icon_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Window_method_has_theme_icon_override>`
|
||
|
||
如果該 :ref:`Control<class_Control>` 節點中存在名為指定 ``name`` 的主題圖示本地覆蓋項,則返回 ``true``\ 。
|
||
|
||
詳情請參閱 :ref:`add_theme_icon_override()<class_Window_method_add_theme_icon_override>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_has_theme_stylebox:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_theme_stylebox**\ (\ name\: :ref:`StringName<class_StringName>`, theme_type\: :ref:`StringName<class_StringName>` = &""\ ) |const| :ref:`🔗<class_Window_method_has_theme_stylebox>`
|
||
|
||
如果樹中存在配對的 :ref:`Theme<class_Theme>`\ ,具有指定名稱 ``name`` 和主題型別 ``theme_type`` 的樣式盒項,則返回 ``true``\ 。
|
||
|
||
詳情見 :ref:`Control.get_theme_color()<class_Control_method_get_theme_color>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_has_theme_stylebox_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_theme_stylebox_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Window_method_has_theme_stylebox_override>`
|
||
|
||
如果該 :ref:`Control<class_Control>` 節點中存在名為指定 ``name`` 的主題 :ref:`StyleBox<class_StyleBox>` 本地覆蓋項,則返回 ``true``\ 。
|
||
|
||
詳情請參閱 :ref:`add_theme_stylebox_override()<class_Window_method_add_theme_stylebox_override>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_hide:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **hide**\ (\ ) :ref:`🔗<class_Window_method_hide>`
|
||
|
||
隱藏該視窗。與最小化狀態不同。隱藏視窗無法進行互動,需要用 :ref:`show()<class_Window_method_show>` 顯示。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_is_embedded:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_embedded**\ (\ ) |const| :ref:`🔗<class_Window_method_is_embedded>`
|
||
|
||
如果該視窗目前嵌入在其他視窗中,則返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_is_layout_rtl:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_layout_rtl**\ (\ ) |const| :ref:`🔗<class_Window_method_is_layout_rtl>`
|
||
|
||
Returns ``true`` if the layout is right-to-left.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_is_maximize_allowed:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_maximize_allowed**\ (\ ) |const| :ref:`🔗<class_Window_method_is_maximize_allowed>`
|
||
|
||
如果該視窗可以最大化(啟用了最大化按鈕),則返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_is_using_font_oversampling:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_using_font_oversampling**\ (\ ) |const| :ref:`🔗<class_Window_method_is_using_font_oversampling>`
|
||
|
||
如果啟用了字形過取樣,則返回 ``true``\ 。見 :ref:`set_use_font_oversampling()<class_Window_method_set_use_font_oversampling>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_move_to_center:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **move_to_center**\ (\ ) :ref:`🔗<class_Window_method_move_to_center>`
|
||
|
||
Centers the window in the current screen. If the window is embedded, it is centered in the embedder :ref:`Viewport<class_Viewport>` instead.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_move_to_foreground:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **move_to_foreground**\ (\ ) :ref:`🔗<class_Window_method_move_to_foreground>`
|
||
|
||
**已棄用:** Use :ref:`grab_focus()<class_Window_method_grab_focus>` instead.
|
||
|
||
使該視窗獲得焦點,從而接收使用者輸入。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_popup:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup**\ (\ rect\: :ref:`Rect2i<class_Rect2i>` = Rect2i(0, 0, 0, 0)\ ) :ref:`🔗<class_Window_method_popup>`
|
||
|
||
Shows the **Window** and makes it transient (see :ref:`transient<class_Window_property_transient>`). If ``rect`` is provided, it will be set as the **Window**'s size. Fails if called on the main window.
|
||
|
||
If :ref:`ProjectSettings.display/window/subwindows/embed_subwindows<class_ProjectSettings_property_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 :ref:`ProjectSettings.display/window/subwindows/embed_subwindows<class_ProjectSettings_property_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.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_popup_centered:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_centered**\ (\ minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0)\ ) :ref:`🔗<class_Window_method_popup_centered>`
|
||
|
||
在目前螢幕的中心彈出該 **Window**\ ,可以選擇給定最小尺寸。如果該 **Window** 是嵌入的,它將在父 :ref:`Viewport<class_Viewport>` 中居中。
|
||
|
||
\ **注意:**\ 用 ``minsize`` 的預設值呼叫它等同於用 :ref:`size<class_Window_property_size>` 呼叫它。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_popup_centered_clamped:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_centered_clamped**\ (\ minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0), fallback_ratio\: :ref:`float<class_float>` = 0.75\ ) :ref:`🔗<class_Window_method_popup_centered_clamped>`
|
||
|
||
在父 **Window** 中居中彈出該 **Window**\ 。\ ``fallback_ratio`` 確定 **Window** 相對於其父級的最大尺寸。
|
||
|
||
\ **注意:**\ 用 ``minsize`` 的預設值呼叫它等同於用 :ref:`size<class_Window_property_size>` 呼叫它。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_popup_centered_ratio:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_centered_ratio**\ (\ ratio\: :ref:`float<class_float>` = 0.8\ ) :ref:`🔗<class_Window_method_popup_centered_ratio>`
|
||
|
||
如果 **Window** 為嵌入式視窗,則 **Window** 在彈出時會在嵌入器內居中,並按照嵌入器大小的比例 ``ratio`` 設定其大小。
|
||
|
||
如果 **Window** 為原生視窗,則 **Window** 在彈出時會在其父 **Window** 所在螢幕內居中,並按照螢幕大小的比例 ``ratio`` 設定其大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_popup_exclusive:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_exclusive**\ (\ from_node\: :ref:`Node<class_Node>`, rect\: :ref:`Rect2i<class_Rect2i>` = Rect2i(0, 0, 0, 0)\ ) :ref:`🔗<class_Window_method_popup_exclusive>`
|
||
|
||
嘗試將該對話方塊的父節點設為最近的獨佔視窗,相對於 ``from_node``\ ,然後對其呼叫 :ref:`popup()<class_Window_method_popup>`\ 。對話方塊目前必須沒有父節點,否則該方法會失敗。
|
||
|
||
另見 :ref:`set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>` 和 :ref:`Node.get_last_exclusive_window()<class_Node_method_get_last_exclusive_window>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_popup_exclusive_centered:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_exclusive_centered**\ (\ from_node\: :ref:`Node<class_Node>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0)\ ) :ref:`🔗<class_Window_method_popup_exclusive_centered>`
|
||
|
||
嘗試將該對話方塊的父節點設為最近的獨佔視窗,相對於 ``from_node``\ ,然後對其呼叫 :ref:`popup_centered()<class_Window_method_popup_centered>`\ 。對話方塊目前必須沒有父節點,否則該方法會失敗。
|
||
|
||
另見 :ref:`set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>` 和 :ref:`Node.get_last_exclusive_window()<class_Node_method_get_last_exclusive_window>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_popup_exclusive_centered_clamped:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_exclusive_centered_clamped**\ (\ from_node\: :ref:`Node<class_Node>`, minsize\: :ref:`Vector2i<class_Vector2i>` = Vector2i(0, 0), fallback_ratio\: :ref:`float<class_float>` = 0.75\ ) :ref:`🔗<class_Window_method_popup_exclusive_centered_clamped>`
|
||
|
||
嘗試將該對話方塊的父節點設為最近的獨佔視窗,相對於 ``from_node``\ ,然後對其呼叫 :ref:`popup_centered_clamped()<class_Window_method_popup_centered_clamped>`\ 。對話方塊目前必須沒有父節點,否則該方法會失敗。
|
||
|
||
另見 :ref:`set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>` 和 :ref:`Node.get_last_exclusive_window()<class_Node_method_get_last_exclusive_window>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_popup_exclusive_centered_ratio:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_exclusive_centered_ratio**\ (\ from_node\: :ref:`Node<class_Node>`, ratio\: :ref:`float<class_float>` = 0.8\ ) :ref:`🔗<class_Window_method_popup_exclusive_centered_ratio>`
|
||
|
||
嘗試將該對話方塊的父節點設為最近的獨佔視窗,相對於 ``from_node``\ ,然後對其呼叫 :ref:`popup_centered_ratio()<class_Window_method_popup_centered_ratio>`\ 。對話方塊目前必須沒有父節點,否則該方法會失敗。
|
||
|
||
另見 :ref:`set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>` 和 :ref:`Node.get_last_exclusive_window()<class_Node_method_get_last_exclusive_window>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_popup_exclusive_on_parent:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_exclusive_on_parent**\ (\ from_node\: :ref:`Node<class_Node>`, parent_rect\: :ref:`Rect2i<class_Rect2i>`\ ) :ref:`🔗<class_Window_method_popup_exclusive_on_parent>`
|
||
|
||
嘗試將該對話方塊的父節點設為最近的獨佔視窗,相對於 ``from_node``\ ,然後對其呼叫 :ref:`popup_on_parent()<class_Window_method_popup_on_parent>`\ 。對話方塊目前必須沒有父節點,否則該方法會失敗。
|
||
|
||
另見 :ref:`set_unparent_when_invisible()<class_Window_method_set_unparent_when_invisible>` 和 :ref:`Node.get_last_exclusive_window()<class_Node_method_get_last_exclusive_window>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_popup_on_parent:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **popup_on_parent**\ (\ parent_rect\: :ref:`Rect2i<class_Rect2i>`\ ) :ref:`🔗<class_Window_method_popup_on_parent>`
|
||
|
||
彈出該 **Window**\ ,位置會根據父級 **Window** 的位置進行偏移。如果該 **Window** 是內嵌的,則與 :ref:`popup()<class_Window_method_popup>` 等效。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_remove_theme_color_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **remove_theme_color_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Window_method_remove_theme_color_override>`
|
||
|
||
移除先前由 :ref:`add_theme_color_override()<class_Window_method_add_theme_color_override>` 或透過屬性檢視器面板所加入,給定主題 :ref:`Color<class_Color>` 的本地覆寫,該覆寫使用指定的 ``name``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_remove_theme_constant_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **remove_theme_constant_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Window_method_remove_theme_constant_override>`
|
||
|
||
移除針對使用指定 ``name`` 的主題常數所設定的本機覆寫,該覆寫先前透過 :ref:`add_theme_constant_override()<class_Window_method_add_theme_constant_override>` 或屬性檢視器面板新增。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_remove_theme_font_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **remove_theme_font_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Window_method_remove_theme_font_override>`
|
||
|
||
移除先前透過 :ref:`add_theme_font_override()<class_Window_method_add_theme_font_override>` 或透過屬性檢視器面板新增的、名稱為指定 ``name`` 的主題 :ref:`Font<class_Font>` 本地覆寫。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_remove_theme_font_size_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **remove_theme_font_size_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Window_method_remove_theme_font_size_override>`
|
||
|
||
移除使用指定的 ``name``\ ,先前由 :ref:`add_theme_font_size_override()<class_Window_method_add_theme_font_size_override>` 或透過屬性檢視器面板新增的主題字型大小的本地覆寫。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_remove_theme_icon_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **remove_theme_icon_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Window_method_remove_theme_icon_override>`
|
||
|
||
移除先前透過 :ref:`add_theme_icon_override()<class_Window_method_add_theme_icon_override>` 或屬性檢視器面板新增的、具有指定 ``name`` 的主題圖示本地覆寫。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_remove_theme_stylebox_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **remove_theme_stylebox_override**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Window_method_remove_theme_stylebox_override>`
|
||
|
||
移除先前由 :ref:`add_theme_stylebox_override()<class_Window_method_add_theme_stylebox_override>` 或透過屬性檢視器面板新增的、具有指定 ``name`` 的主題 :ref:`StyleBox<class_StyleBox>` 本地覆寫。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_request_attention:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **request_attention**\ (\ ) :ref:`🔗<class_Window_method_request_attention>`
|
||
|
||
告訴作業系統 **Window** 需要注意。這樣會讓該視窗以某種方式脫穎而出,具體形式取決於系統,例如可能會在工作列上閃爍。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_reset_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **reset_size**\ (\ ) :ref:`🔗<class_Window_method_reset_size>`
|
||
|
||
將大小重設為最小大小,即 :ref:`min_size<class_Window_property_min_size>` 和(\ :ref:`wrap_controls<class_Window_property_wrap_controls>` 啟用時)\ :ref:`get_contents_minimum_size()<class_Window_method_get_contents_minimum_size>` 之間的較大值。相當於呼叫 ``set_size(Vector2i())``\ (或低於最小值的任何大小)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_set_flag:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_flag**\ (\ flag\: :ref:`Flags<enum_Window_Flags>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Window_method_set_flag>`
|
||
|
||
設定指定的視窗旗標。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_set_ime_active:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_ime_active**\ (\ active\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Window_method_set_ime_active>`
|
||
|
||
如果 ``active`` 為 ``true``\ ,則啟用系統的原生 IME(輸入法編輯器)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_set_ime_position:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_ime_position**\ (\ position\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_Window_method_set_ime_position>`
|
||
|
||
將 IME 移動到給定位置。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_set_layout_direction:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_layout_direction**\ (\ direction\: :ref:`LayoutDirection<enum_Window_LayoutDirection>`\ ) :ref:`🔗<class_Window_method_set_layout_direction>`
|
||
|
||
設定佈局方向和文字書寫方向。某些語言需要從右至左的佈局(例如阿拉伯語和希伯來語)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_set_unparent_when_invisible:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_unparent_when_invisible**\ (\ unparent\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Window_method_set_unparent_when_invisible>`
|
||
|
||
如果 ``unparent`` 為 ``true``\ ,則視窗會在隱藏時自動解除與父節點的關係。
|
||
|
||
\ **注意:**\ 請確保存在對該節點的引用,否則該節點會變為孤兒節點。沒有父節點時,你還需要手動呼叫 :ref:`Node.queue_free()<class_Node_method_queue_free>` 來釋放該視窗。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_set_use_font_oversampling:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_use_font_oversampling**\ (\ enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Window_method_set_use_font_oversampling>`
|
||
|
||
啟用字形過取樣。會使得字形在放大後更好看。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_show:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **show**\ (\ ) :ref:`🔗<class_Window_method_show>`
|
||
|
||
讓該 **Window** 出現。這樣會啟用與 **Window** 的互動,除了可見性之外不會更改其他任何屬性(與 :ref:`popup()<class_Window_method_popup>` 不同)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_start_drag:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **start_drag**\ (\ ) :ref:`🔗<class_Window_method_start_drag>`
|
||
|
||
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.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_method_start_resize:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **start_resize**\ (\ edge\: :ref:`WindowResizeEdge<enum_DisplayServer_WindowResizeEdge>`\ ) :ref:`🔗<class_Window_method_start_resize>`
|
||
|
||
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.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
主題屬性說明
|
||
------------
|
||
|
||
.. _class_Window_theme_color_title_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **title_color** = ``Color(0.875, 0.875, 0.875, 1)`` :ref:`🔗<class_Window_theme_color_title_color>`
|
||
|
||
標題文字的顏色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_theme_color_title_outline_modulate:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **title_outline_modulate** = ``Color(0, 0, 0, 1)`` :ref:`🔗<class_Window_theme_color_title_outline_modulate>`
|
||
|
||
標題文字輪廓的顏色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_theme_constant_close_h_offset:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **close_h_offset** = ``18`` :ref:`🔗<class_Window_theme_constant_close_h_offset>`
|
||
|
||
Horizontal position offset of the close button, relative to the end of the title bar, towards the beginning of the title bar.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_theme_constant_close_v_offset:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **close_v_offset** = ``24`` :ref:`🔗<class_Window_theme_constant_close_v_offset>`
|
||
|
||
Vertical position offset of the close button, relative to the bottom of the title bar, towards the top of the title bar.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_theme_constant_resize_margin:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **resize_margin** = ``4`` :ref:`🔗<class_Window_theme_constant_resize_margin>`
|
||
|
||
定義了視窗邊框外側可以使用滑鼠抓取和調整大小的邊距。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_theme_constant_title_height:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **title_height** = ``36`` :ref:`🔗<class_Window_theme_constant_title_height>`
|
||
|
||
標題列的高度。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_theme_constant_title_outline_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **title_outline_size** = ``0`` :ref:`🔗<class_Window_theme_constant_title_outline_size>`
|
||
|
||
標題輪廓的尺寸。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_theme_font_title_font:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Font<class_Font>` **title_font** :ref:`🔗<class_Window_theme_font_title_font>`
|
||
|
||
用於繪製標題的字形。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_theme_font_size_title_font_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **title_font_size** :ref:`🔗<class_Window_theme_font_size_title_font_size>`
|
||
|
||
標題字形的大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_theme_icon_close:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **close** :ref:`🔗<class_Window_theme_icon_close>`
|
||
|
||
關閉按鈕的圖示。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_theme_icon_close_pressed:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **close_pressed** :ref:`🔗<class_Window_theme_icon_close_pressed>`
|
||
|
||
關閉按鈕被按下時的圖示。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_theme_style_embedded_border:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **embedded_border** :ref:`🔗<class_Window_theme_style_embedded_border>`
|
||
|
||
**Window** 為嵌入模式時使用的背景樣式。請注意,背景僅繪製在視窗內容的下方,不包括標題。要得到合適的邊框和標題列樣式,可以使用 :ref:`StyleBoxFlat<class_StyleBoxFlat>` 的 ``expand_margin_*`` 屬性。
|
||
|
||
\ **注意:**\ 只有在啟用 :ref:`transparent<class_Window_property_transparent>` 時,內容背景才會可見。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Window_theme_style_embedded_unfocused_border:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **embedded_unfocused_border** :ref:`🔗<class_Window_theme_style_embedded_unfocused_border>`
|
||
|
||
:ref:`GraphNode<class_GraphNode>` 被選中時使用的背景。
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)`
|
||
.. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)`
|
||
.. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)`
|
||
.. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)`
|
||
.. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)`
|
||
.. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)`
|
||
.. |void| replace:: :abbr:`void (無回傳值。)`
|