Files
godot-docs/classes/class_editorselection.rst
2025-02-15 03:21:09 +00:00

138 lines
5.7 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/EditorSelection.xml.
.. _class_EditorSelection:
EditorSelection
===============
**Inherits:** :ref:`Object<class_Object>`
Manages the SceneTree selection in the editor.
.. rst-class:: classref-introduction-group
Description
-----------
This object manages the SceneTree selection in the editor.
\ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_selection()<class_EditorInterface_method_get_selection>`.
.. rst-class:: classref-reftable-group
Methods
-------
.. 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_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
Signals
-------
.. _class_EditorSelection_signal_selection_changed:
.. rst-class:: classref-signal
**selection_changed**\ (\ ) :ref:`🔗<class_EditorSelection_signal_selection_changed>`
Emitted when the selection changes.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_EditorSelection_method_add_node:
.. rst-class:: classref-method
|void| **add_node**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_EditorSelection_method_add_node>`
Adds a node to the selection.
\ **Note:** The newly selected node will not be automatically edited in the inspector. If you want to edit a node, use :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>`
Clear the selection.
.. 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_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>`
Returns the list of selected nodes, optimized for transform operations (i.e. moving them, rotating, etc.). This list can be used to avoid situations where a node is selected and is also a child/grandchild.
.. 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>`
Removes a node from the selection.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
.. |void| replace:: :abbr:`void (No return value.)`