class_editorselection.rst 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the EditorSelection.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_EditorSelection:
  6. EditorSelection
  7. ===============
  8. **Inherits:** :ref:`Object<class_Object>`
  9. Manages the SceneTree selection in the editor.
  10. Description
  11. -----------
  12. This object manages the SceneTree selection in the editor.
  13. **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_selection<class_EditorInterface_method_get_selection>`.
  14. Methods
  15. -------
  16. +---------------------------+--------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`add_node<class_EditorSelection_method_add_node>` **(** :ref:`Node<class_Node>` node **)** |
  18. +---------------------------+--------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`clear<class_EditorSelection_method_clear>` **(** **)** |
  20. +---------------------------+--------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`Array<class_Array>` | :ref:`get_selected_nodes<class_EditorSelection_method_get_selected_nodes>` **(** **)** |
  22. +---------------------------+--------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`Array<class_Array>` | :ref:`get_transformable_selected_nodes<class_EditorSelection_method_get_transformable_selected_nodes>` **(** **)** |
  24. +---------------------------+--------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`remove_node<class_EditorSelection_method_remove_node>` **(** :ref:`Node<class_Node>` node **)** |
  26. +---------------------------+--------------------------------------------------------------------------------------------------------------------+
  27. Signals
  28. -------
  29. .. _class_EditorSelection_signal_selection_changed:
  30. - **selection_changed** **(** **)**
  31. Emitted when the selection changes.
  32. Method Descriptions
  33. -------------------
  34. .. _class_EditorSelection_method_add_node:
  35. - void **add_node** **(** :ref:`Node<class_Node>` node **)**
  36. Adds a node to the selection.
  37. **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>`.
  38. ----
  39. .. _class_EditorSelection_method_clear:
  40. - void **clear** **(** **)**
  41. Clear the selection.
  42. ----
  43. .. _class_EditorSelection_method_get_selected_nodes:
  44. - :ref:`Array<class_Array>` **get_selected_nodes** **(** **)**
  45. Gets the list of selected nodes.
  46. ----
  47. .. _class_EditorSelection_method_get_transformable_selected_nodes:
  48. - :ref:`Array<class_Array>` **get_transformable_selected_nodes** **(** **)**
  49. Gets the list of selected nodes, optimized for transform operations (i.e. moving them, rotating, etc). This list avoids situations where a node is selected and also child/grandchild.
  50. ----
  51. .. _class_EditorSelection_method_remove_node:
  52. - void **remove_node** **(** :ref:`Node<class_Node>` node **)**
  53. Removes a node from the selection.
  54. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  55. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  56. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`