class_visibleonscreenenabler2d.rst 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/VisibleOnScreenEnabler2D.xml.
  6. .. _class_VisibleOnScreenEnabler2D:
  7. VisibleOnScreenEnabler2D
  8. ========================
  9. **Inherits:** :ref:`VisibleOnScreenNotifier2D<class_VisibleOnScreenNotifier2D>` **<** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Automatically disables another node if not visible on screen.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. VisibleOnScreenEnabler2D detects when it is visible on screen (just like :ref:`VisibleOnScreenNotifier2D<class_VisibleOnScreenNotifier2D>`) and automatically enables or disables the target node. The target node is disabled when **VisibleOnScreenEnabler2D** is not visible on screen (including when :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` is ``false``), and enabled when the enabler is visible. The disabling is achieved by changing :ref:`Node.process_mode<class_Node_property_process_mode>`.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +-------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------+
  21. | :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>` | :ref:`enable_mode<class_VisibleOnScreenEnabler2D_property_enable_mode>` | ``0`` |
  22. +-------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------+
  23. | :ref:`NodePath<class_NodePath>` | :ref:`enable_node_path<class_VisibleOnScreenEnabler2D_property_enable_node_path>` | ``NodePath("..")`` |
  24. +-------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------+
  25. .. rst-class:: classref-section-separator
  26. ----
  27. .. rst-class:: classref-descriptions-group
  28. Enumerations
  29. ------------
  30. .. _enum_VisibleOnScreenEnabler2D_EnableMode:
  31. .. rst-class:: classref-enumeration
  32. enum **EnableMode**:
  33. .. _class_VisibleOnScreenEnabler2D_constant_ENABLE_MODE_INHERIT:
  34. .. rst-class:: classref-enumeration-constant
  35. :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>` **ENABLE_MODE_INHERIT** = ``0``
  36. Corresponds to :ref:`Node.PROCESS_MODE_INHERIT<class_Node_constant_PROCESS_MODE_INHERIT>`.
  37. .. _class_VisibleOnScreenEnabler2D_constant_ENABLE_MODE_ALWAYS:
  38. .. rst-class:: classref-enumeration-constant
  39. :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>` **ENABLE_MODE_ALWAYS** = ``1``
  40. Corresponds to :ref:`Node.PROCESS_MODE_ALWAYS<class_Node_constant_PROCESS_MODE_ALWAYS>`.
  41. .. _class_VisibleOnScreenEnabler2D_constant_ENABLE_MODE_WHEN_PAUSED:
  42. .. rst-class:: classref-enumeration-constant
  43. :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>` **ENABLE_MODE_WHEN_PAUSED** = ``2``
  44. Corresponds to :ref:`Node.PROCESS_MODE_WHEN_PAUSED<class_Node_constant_PROCESS_MODE_WHEN_PAUSED>`.
  45. .. rst-class:: classref-section-separator
  46. ----
  47. .. rst-class:: classref-descriptions-group
  48. Property Descriptions
  49. ---------------------
  50. .. _class_VisibleOnScreenEnabler2D_property_enable_mode:
  51. .. rst-class:: classref-property
  52. :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>` **enable_mode** = ``0``
  53. .. rst-class:: classref-property-setget
  54. - void **set_enable_mode** **(** :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>` value **)**
  55. - :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>` **get_enable_mode** **(** **)**
  56. Determines how the node is enabled. Corresponds to :ref:`ProcessMode<enum_Node_ProcessMode>`. Disabled node uses :ref:`Node.PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  57. .. rst-class:: classref-item-separator
  58. ----
  59. .. _class_VisibleOnScreenEnabler2D_property_enable_node_path:
  60. .. rst-class:: classref-property
  61. :ref:`NodePath<class_NodePath>` **enable_node_path** = ``NodePath("..")``
  62. .. rst-class:: classref-property-setget
  63. - void **set_enable_node_path** **(** :ref:`NodePath<class_NodePath>` value **)**
  64. - :ref:`NodePath<class_NodePath>` **get_enable_node_path** **(** **)**
  65. The path to the target node, relative to the **VisibleOnScreenEnabler2D**. The target node is cached; it's only assigned when setting this property (if the **VisibleOnScreenEnabler2D** is inside scene tree) and every time the **VisibleOnScreenEnabler2D** enters the scene tree. If the path is invalid, nothing will happen.
  66. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  67. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  68. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  69. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  70. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  71. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`