class_visibilityenabler.rst 2.6 KB

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