class_visibilityenabler2d.rst 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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_VisibilityEnabler2D:
  4. VisibilityEnabler2D
  5. ===================
  6. **Inherits:** :ref:`VisibilityNotifier2D<class_visibilitynotifier2d>` **<** :ref:`Node2D<class_node2d>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :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. | void | :ref:`set_enabler<class_VisibilityEnabler2D_set_enabler>` **(** :ref:`int<class_int>` enabler, :ref:`bool<class_bool>` enabled **)** |
  15. +--------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`bool<class_bool>` | :ref:`is_enabler_enabled<class_VisibilityEnabler2D_is_enabler_enabled>` **(** :ref:`int<class_int>` enabler **)** const |
  17. +--------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  18. Numeric Constants
  19. -----------------
  20. - **ENABLER_FREEZE_BODIES** = **1** --- This enabler will freeze :ref:`RigidBody2D<class_rigidbody2d>` nodes.
  21. - **ENABLER_PAUSE_ANIMATIONS** = **0** --- This enabler will pause :ref:`AnimationPlayer<class_animationplayer>` nodes.
  22. - **ENABLER_PAUSE_PARTICLES** = **2** --- This enabler will stop :ref:`Particles2D<class_particles2d>` nodes.
  23. - **ENABLER_PARENT_PROCESS** = **3** --- This enabler will stop the parent's _process function.
  24. - **ENABLER_PARENT_FIXED_PROCESS** = **4** --- This enabler will stop the parent's _fixed_process function.
  25. - **ENABLER_MAX** = **5**
  26. Description
  27. -----------
  28. The VisibilityEnabler2D will disable :ref:`RigidBody2D<class_rigidbody2d>`, :ref:`AnimationPlayer<class_animationplayer>`, and other nodes when they are not visible. It will only affect other nodes within the same scene as the VisibilityEnabler2D itself.
  29. Member Function Description
  30. ---------------------------
  31. .. _class_VisibilityEnabler2D_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 VisibilityEnabler2D is not in view. See the constants for enablers and what they affect.
  34. .. _class_VisibilityEnabler2D_is_enabler_enabled:
  35. - :ref:`bool<class_bool>` **is_enabler_enabled** **(** :ref:`int<class_int>` enabler **)** const
  36. Returns whether the specified enabler was set to true or not.