class_visibilityenabler2d.rst 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. | :ref:`bool<class_bool>` | :ref:`is_enabler_enabled<class_VisibilityEnabler2D_is_enabler_enabled>` **(** :ref:`int<class_int>` enabler **)** const |
  15. +--------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`set_enabler<class_VisibilityEnabler2D_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:`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_PAUSE_ANIMATED_SPRITES** = **5**
  24. - **ENABLER_PARENT_PROCESS** = **3** --- This enabler will stop the parent's _process function.
  25. - **ENABLER_PARENT_FIXED_PROCESS** = **4** --- This enabler will stop the parent's _fixed_process function.
  26. - **ENABLER_MAX** = **6**
  27. Description
  28. -----------
  29. 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.
  30. Member Function Description
  31. ---------------------------
  32. .. _class_VisibilityEnabler2D_is_enabler_enabled:
  33. - :ref:`bool<class_bool>` **is_enabler_enabled** **(** :ref:`int<class_int>` enabler **)** const
  34. Returns whether the specified enabler was set to true or not.
  35. .. _class_VisibilityEnabler2D_set_enabler:
  36. - void **set_enabler** **(** :ref:`int<class_int>` enabler, :ref:`bool<class_bool>` enabled **)**
  37. 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.