Files
godot-docs-l10n/classes/zh_Hant/class_editorselection.rst

152 lines
6.5 KiB
ReStructuredText

:github_url: hide
.. _class_EditorSelection:
EditorSelection
===============
**繼承:** :ref:`Object<class_Object>`
管理編輯器中的 SceneTree 選擇。
.. rst-class:: classref-introduction-group
說明
----
這個物件管理編輯器中的 SceneTree 選擇。
\ **注意:**\ 這個類不應該直接產生實體。相反,使用\ :ref:`EditorInterface.get_selection()<class_EditorInterface_method_get_selection>`\ 存取單例。
.. rst-class:: classref-reftable-group
方法
----
.. table::
:widths: auto
+------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_node<class_EditorSelection_method_add_node>`\ (\ node\: :ref:`Node<class_Node>`\ ) |
+------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`clear<class_EditorSelection_method_clear>`\ (\ ) |
+------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] | :ref:`get_selected_nodes<class_EditorSelection_method_get_selected_nodes>`\ (\ ) |
+------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] | :ref:`get_top_selected_nodes<class_EditorSelection_method_get_top_selected_nodes>`\ (\ ) |
+------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] | :ref:`get_transformable_selected_nodes<class_EditorSelection_method_get_transformable_selected_nodes>`\ (\ ) |
+------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_node<class_EditorSelection_method_remove_node>`\ (\ node\: :ref:`Node<class_Node>`\ ) |
+------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
訊號
----
.. _class_EditorSelection_signal_selection_changed:
.. rst-class:: classref-signal
**selection_changed**\ (\ ) :ref:`🔗<class_EditorSelection_signal_selection_changed>`
更改選擇時發出。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
方法說明
--------
.. _class_EditorSelection_method_add_node:
.. rst-class:: classref-method
|void| **add_node**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_EditorSelection_method_add_node>`
將一個節點新增到選擇中。
\ **注意:**\ 新選擇的節點不會在屬性檢視器中自動被編輯。如果你想編輯一個節點,請使用 :ref:`EditorInterface.edit_node()<class_EditorInterface_method_edit_node>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_EditorSelection_method_clear:
.. rst-class:: classref-method
|void| **clear**\ (\ ) :ref:`🔗<class_EditorSelection_method_clear>`
清除選中項。
.. rst-class:: classref-item-separator
----
.. _class_EditorSelection_method_get_selected_nodes:
.. rst-class:: classref-method
:ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] **get_selected_nodes**\ (\ ) :ref:`🔗<class_EditorSelection_method_get_selected_nodes>`
Returns the list of selected nodes.
.. rst-class:: classref-item-separator
----
.. _class_EditorSelection_method_get_top_selected_nodes:
.. rst-class:: classref-method
:ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] **get_top_selected_nodes**\ (\ ) :ref:`🔗<class_EditorSelection_method_get_top_selected_nodes>`
Returns the list of top selected nodes only, excluding any children. This is useful for performing transform operations (moving them, rotating, etc.).
For example, if there is a node A with a child B and a sibling C, then selecting all three will cause this method to return only A and C. Changing the global transform of A will affect the global transform of B, so there is no need to change B separately.
.. rst-class:: classref-item-separator
----
.. _class_EditorSelection_method_get_transformable_selected_nodes:
.. rst-class:: classref-method
:ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] **get_transformable_selected_nodes**\ (\ ) :ref:`🔗<class_EditorSelection_method_get_transformable_selected_nodes>`
**已棄用:** Use :ref:`get_top_selected_nodes()<class_EditorSelection_method_get_top_selected_nodes>` instead.
Returns the list of top selected nodes only, excluding any children. This is useful for performing transform operations (moving them, rotating, etc.). See :ref:`get_top_selected_nodes()<class_EditorSelection_method_get_top_selected_nodes>`.
.. rst-class:: classref-item-separator
----
.. _class_EditorSelection_method_remove_node:
.. rst-class:: classref-method
|void| **remove_node**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_EditorSelection_method_remove_node>`
從選擇中刪除一個節點。
.. |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 (無回傳值。)`