class_visibleonscreenenabler2d.rst 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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/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. A rectangular region of 2D space that, when visible on screen, enables a target node.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **VisibleOnScreenEnabler2D** contains a rectangular region of 2D space and a target node. The target node will be automatically enabled (via its :ref:`Node.process_mode<class_Node_property_process_mode>` property) when any part of this region becomes visible on the screen, and automatically disabled otherwise. This can for example be used to activate enemies only when the player approaches them.
  15. See :ref:`VisibleOnScreenNotifier2D<class_VisibleOnScreenNotifier2D>` if you only want to be notified when the region is visible on screen.
  16. \ **Note:** **VisibleOnScreenEnabler2D** uses the render culling code to determine whether it's visible on screen, so it won't function unless :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` is set to ``true``.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------+
  23. | :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>` | :ref:`enable_mode<class_VisibleOnScreenEnabler2D_property_enable_mode>` | ``0`` |
  24. +-------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------+
  25. | :ref:`NodePath<class_NodePath>` | :ref:`enable_node_path<class_VisibleOnScreenEnabler2D_property_enable_node_path>` | ``NodePath("..")`` |
  26. +-------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------+
  27. .. rst-class:: classref-section-separator
  28. ----
  29. .. rst-class:: classref-descriptions-group
  30. Enumerations
  31. ------------
  32. .. _enum_VisibleOnScreenEnabler2D_EnableMode:
  33. .. rst-class:: classref-enumeration
  34. enum **EnableMode**: :ref:`🔗<enum_VisibleOnScreenEnabler2D_EnableMode>`
  35. .. _class_VisibleOnScreenEnabler2D_constant_ENABLE_MODE_INHERIT:
  36. .. rst-class:: classref-enumeration-constant
  37. :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>` **ENABLE_MODE_INHERIT** = ``0``
  38. Corresponds to :ref:`Node.PROCESS_MODE_INHERIT<class_Node_constant_PROCESS_MODE_INHERIT>`.
  39. .. _class_VisibleOnScreenEnabler2D_constant_ENABLE_MODE_ALWAYS:
  40. .. rst-class:: classref-enumeration-constant
  41. :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>` **ENABLE_MODE_ALWAYS** = ``1``
  42. Corresponds to :ref:`Node.PROCESS_MODE_ALWAYS<class_Node_constant_PROCESS_MODE_ALWAYS>`.
  43. .. _class_VisibleOnScreenEnabler2D_constant_ENABLE_MODE_WHEN_PAUSED:
  44. .. rst-class:: classref-enumeration-constant
  45. :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>` **ENABLE_MODE_WHEN_PAUSED** = ``2``
  46. Corresponds to :ref:`Node.PROCESS_MODE_WHEN_PAUSED<class_Node_constant_PROCESS_MODE_WHEN_PAUSED>`.
  47. .. rst-class:: classref-section-separator
  48. ----
  49. .. rst-class:: classref-descriptions-group
  50. Property Descriptions
  51. ---------------------
  52. .. _class_VisibleOnScreenEnabler2D_property_enable_mode:
  53. .. rst-class:: classref-property
  54. :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>` **enable_mode** = ``0`` :ref:`🔗<class_VisibleOnScreenEnabler2D_property_enable_mode>`
  55. .. rst-class:: classref-property-setget
  56. - |void| **set_enable_mode**\ (\ value\: :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>`\ )
  57. - :ref:`EnableMode<enum_VisibleOnScreenEnabler2D_EnableMode>` **get_enable_mode**\ (\ )
  58. Determines how the target node is enabled. Corresponds to :ref:`ProcessMode<enum_Node_ProcessMode>`. When the node is disabled, it always uses :ref:`Node.PROCESS_MODE_DISABLED<class_Node_constant_PROCESS_MODE_DISABLED>`.
  59. .. rst-class:: classref-item-separator
  60. ----
  61. .. _class_VisibleOnScreenEnabler2D_property_enable_node_path:
  62. .. rst-class:: classref-property
  63. :ref:`NodePath<class_NodePath>` **enable_node_path** = ``NodePath("..")`` :ref:`🔗<class_VisibleOnScreenEnabler2D_property_enable_node_path>`
  64. .. rst-class:: classref-property-setget
  65. - |void| **set_enable_node_path**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
  66. - :ref:`NodePath<class_NodePath>` **get_enable_node_path**\ (\ )
  67. 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 the scene tree) and every time the **VisibleOnScreenEnabler2D** enters the scene tree. If the path is empty, no node will be affected. If the path is invalid, an error is also generated.
  68. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  69. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  70. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  71. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  72. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  73. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  74. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  75. .. |void| replace:: :abbr:`void (No return value.)`