class_editorselection.rst 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/EditorSelection.xml.
  6. .. _class_EditorSelection:
  7. EditorSelection
  8. ===============
  9. **Inherits:** :ref:`Object<class_Object>`
  10. Manages the SceneTree selection in the editor.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This object manages the SceneTree selection in the editor.
  15. \ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_selection()<class_EditorInterface_method_get_selection>`.
  16. .. rst-class:: classref-reftable-group
  17. Methods
  18. -------
  19. .. table::
  20. :widths: auto
  21. +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
  22. | |void| | :ref:`add_node<class_EditorSelection_method_add_node>`\ (\ node\: :ref:`Node<class_Node>`\ ) |
  23. +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
  24. | |void| | :ref:`clear<class_EditorSelection_method_clear>`\ (\ ) |
  25. +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
  26. | :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] | :ref:`get_selected_nodes<class_EditorSelection_method_get_selected_nodes>`\ (\ ) |
  27. +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
  28. | :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] | :ref:`get_top_selected_nodes<class_EditorSelection_method_get_top_selected_nodes>`\ (\ ) |
  29. +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
  30. | :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] | :ref:`get_transformable_selected_nodes<class_EditorSelection_method_get_transformable_selected_nodes>`\ (\ ) |
  31. +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
  32. | |void| | :ref:`remove_node<class_EditorSelection_method_remove_node>`\ (\ node\: :ref:`Node<class_Node>`\ ) |
  33. +------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
  34. .. rst-class:: classref-section-separator
  35. ----
  36. .. rst-class:: classref-descriptions-group
  37. Signals
  38. -------
  39. .. _class_EditorSelection_signal_selection_changed:
  40. .. rst-class:: classref-signal
  41. **selection_changed**\ (\ ) :ref:`🔗<class_EditorSelection_signal_selection_changed>`
  42. Emitted when the selection changes.
  43. .. rst-class:: classref-section-separator
  44. ----
  45. .. rst-class:: classref-descriptions-group
  46. Method Descriptions
  47. -------------------
  48. .. _class_EditorSelection_method_add_node:
  49. .. rst-class:: classref-method
  50. |void| **add_node**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_EditorSelection_method_add_node>`
  51. Adds a node to the selection.
  52. \ **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>`.
  53. .. rst-class:: classref-item-separator
  54. ----
  55. .. _class_EditorSelection_method_clear:
  56. .. rst-class:: classref-method
  57. |void| **clear**\ (\ ) :ref:`🔗<class_EditorSelection_method_clear>`
  58. Clear the selection.
  59. .. rst-class:: classref-item-separator
  60. ----
  61. .. _class_EditorSelection_method_get_selected_nodes:
  62. .. rst-class:: classref-method
  63. :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] **get_selected_nodes**\ (\ ) :ref:`🔗<class_EditorSelection_method_get_selected_nodes>`
  64. Returns the list of selected nodes.
  65. .. rst-class:: classref-item-separator
  66. ----
  67. .. _class_EditorSelection_method_get_top_selected_nodes:
  68. .. rst-class:: classref-method
  69. :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] **get_top_selected_nodes**\ (\ ) :ref:`🔗<class_EditorSelection_method_get_top_selected_nodes>`
  70. Returns the list of top selected nodes only, excluding any children. This is useful for performing transform operations (moving them, rotating, etc.).
  71. 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.
  72. .. rst-class:: classref-item-separator
  73. ----
  74. .. _class_EditorSelection_method_get_transformable_selected_nodes:
  75. .. rst-class:: classref-method
  76. :ref:`Array<class_Array>`\[:ref:`Node<class_Node>`\] **get_transformable_selected_nodes**\ (\ ) :ref:`🔗<class_EditorSelection_method_get_transformable_selected_nodes>`
  77. **Deprecated:** Use :ref:`get_top_selected_nodes()<class_EditorSelection_method_get_top_selected_nodes>` instead.
  78. 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>`.
  79. .. rst-class:: classref-item-separator
  80. ----
  81. .. _class_EditorSelection_method_remove_node:
  82. .. rst-class:: classref-method
  83. |void| **remove_node**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_EditorSelection_method_remove_node>`
  84. Removes a node from the selection.
  85. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  86. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  87. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  88. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  89. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  90. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  91. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  92. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  93. .. |void| replace:: :abbr:`void (No return value.)`