class_visibilityenabler.rst 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_VisibilityEnabler:
  4. VisibilityEnabler
  5. =================
  6. **Inherits:** :ref:`VisibilityNotifier<class_visibilitynotifier>` **<** :ref:`Spatial<class_spatial>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Enable certain nodes only when visible.
  11. Member Functions
  12. ----------------
  13. +--------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`bool<class_bool>` | :ref:`is_enabler_enabled<class_VisibilityEnabler_is_enabler_enabled>` **(** :ref:`int<class_int>` enabler **)** const |
  15. +--------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`set_enabler<class_VisibilityEnabler_set_enabler>` **(** :ref:`int<class_int>` enabler, :ref:`bool<class_bool>` enabled **)** |
  17. +--------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  18. Numeric Constants
  19. -----------------
  20. - **ENABLER_FREEZE_BODIES** = **1** --- This enabler will freeze :ref:`RigidBody<class_rigidbody>` nodes.
  21. - **ENABLER_PAUSE_ANIMATIONS** = **0** --- This enabler will pause :ref:`AnimationPlayer<class_animationplayer>` nodes.
  22. - **ENABLER_MAX** = **2**
  23. Description
  24. -----------
  25. 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.
  26. Member Function Description
  27. ---------------------------
  28. .. _class_VisibilityEnabler_is_enabler_enabled:
  29. - :ref:`bool<class_bool>` **is_enabler_enabled** **(** :ref:`int<class_int>` enabler **)** const
  30. Returns whether the specified enabler was set to true or not.
  31. .. _class_VisibilityEnabler_set_enabler:
  32. - void **set_enabler** **(** :ref:`int<class_int>` enabler, :ref:`bool<class_bool>` enabled **)**
  33. Set an enabler to true for all nodes of its type to be disabled when the VisibilityEnabler is not in view. See the constants for enablers and what they affect.