class_visibilityenabler.rst 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the VisibilityEnabler.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_VisibilityEnabler:
  6. VisibilityEnabler
  7. =================
  8. **Inherits:** :ref:`VisibilityNotifier<class_VisibilityNotifier>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Enables certain nodes only when visible.
  10. Description
  11. -----------
  12. The VisibilityEnabler will disable :ref:`RigidBody<class_RigidBody>` and :ref:`AnimationPlayer<class_AnimationPlayer>` nodes when they are not visible. It will only affect other nodes within the same scene as the VisibilityEnabler itself.
  13. Note that VisibilityEnabler will not affect nodes added after scene initialization.
  14. Properties
  15. ----------
  16. +-------------------------+----------------------------------------------------------------------------+----------+
  17. | :ref:`bool<class_bool>` | :ref:`freeze_bodies<class_VisibilityEnabler_property_freeze_bodies>` | ``true`` |
  18. +-------------------------+----------------------------------------------------------------------------+----------+
  19. | :ref:`bool<class_bool>` | :ref:`pause_animations<class_VisibilityEnabler_property_pause_animations>` | ``true`` |
  20. +-------------------------+----------------------------------------------------------------------------+----------+
  21. Methods
  22. -------
  23. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`is_enabler_enabled<class_VisibilityEnabler_method_is_enabler_enabled>` **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler **)** const |
  25. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`set_enabler<class_VisibilityEnabler_method_set_enabler>` **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler, :ref:`bool<class_bool>` enabled **)** |
  27. +-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. Enumerations
  29. ------------
  30. .. _enum_VisibilityEnabler_Enabler:
  31. .. _class_VisibilityEnabler_constant_ENABLER_PAUSE_ANIMATIONS:
  32. .. _class_VisibilityEnabler_constant_ENABLER_FREEZE_BODIES:
  33. .. _class_VisibilityEnabler_constant_ENABLER_MAX:
  34. enum **Enabler**:
  35. - **ENABLER_PAUSE_ANIMATIONS** = **0** --- This enabler will pause :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
  36. - **ENABLER_FREEZE_BODIES** = **1** --- This enabler will freeze :ref:`RigidBody<class_RigidBody>` nodes.
  37. - **ENABLER_MAX** = **2** --- Represents the size of the :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enum.
  38. Property Descriptions
  39. ---------------------
  40. .. _class_VisibilityEnabler_property_freeze_bodies:
  41. - :ref:`bool<class_bool>` **freeze_bodies**
  42. +-----------+----------------------+
  43. | *Default* | ``true`` |
  44. +-----------+----------------------+
  45. | *Setter* | set_enabler(value) |
  46. +-----------+----------------------+
  47. | *Getter* | is_enabler_enabled() |
  48. +-----------+----------------------+
  49. If ``true``, :ref:`RigidBody<class_RigidBody>` nodes will be paused.
  50. ----
  51. .. _class_VisibilityEnabler_property_pause_animations:
  52. - :ref:`bool<class_bool>` **pause_animations**
  53. +-----------+----------------------+
  54. | *Default* | ``true`` |
  55. +-----------+----------------------+
  56. | *Setter* | set_enabler(value) |
  57. +-----------+----------------------+
  58. | *Getter* | is_enabler_enabled() |
  59. +-----------+----------------------+
  60. If ``true``, :ref:`AnimationPlayer<class_AnimationPlayer>` nodes will be paused.
  61. Method Descriptions
  62. -------------------
  63. .. _class_VisibilityEnabler_method_is_enabler_enabled:
  64. - :ref:`bool<class_bool>` **is_enabler_enabled** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler **)** const
  65. Returns whether the enabler identified by given :ref:`Enabler<enum_VisibilityEnabler_Enabler>` constant is active.
  66. ----
  67. .. _class_VisibilityEnabler_method_set_enabler:
  68. - void **set_enabler** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler, :ref:`bool<class_bool>` enabled **)**
  69. Sets active state of the enabler identified by given :ref:`Enabler<enum_VisibilityEnabler_Enabler>` constant.