mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
110 lines
4.5 KiB
ReStructuredText
110 lines
4.5 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the VisibilityEnabler.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_VisibilityEnabler:
|
|
|
|
VisibilityEnabler
|
|
=================
|
|
|
|
**Inherits:** :ref:`VisibilityNotifier<class_VisibilityNotifier>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
Enables certain nodes only when visible.
|
|
|
|
Description
|
|
-----------
|
|
|
|
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.
|
|
|
|
Note that VisibilityEnabler will not affect nodes added after scene initialization.
|
|
|
|
Properties
|
|
----------
|
|
|
|
+-------------------------+----------------------------------------------------------------------------+----------+
|
|
| :ref:`bool<class_bool>` | :ref:`freeze_bodies<class_VisibilityEnabler_property_freeze_bodies>` | ``true`` |
|
|
+-------------------------+----------------------------------------------------------------------------+----------+
|
|
| :ref:`bool<class_bool>` | :ref:`pause_animations<class_VisibilityEnabler_property_pause_animations>` | ``true`` |
|
|
+-------------------------+----------------------------------------------------------------------------+----------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_enabler_enabled<class_VisibilityEnabler_method_is_enabler_enabled>` **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler **)** const |
|
|
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_enabler<class_VisibilityEnabler_method_set_enabler>` **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler, :ref:`bool<class_bool>` enabled **)** |
|
|
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Enumerations
|
|
------------
|
|
|
|
.. _enum_VisibilityEnabler_Enabler:
|
|
|
|
.. _class_VisibilityEnabler_constant_ENABLER_PAUSE_ANIMATIONS:
|
|
|
|
.. _class_VisibilityEnabler_constant_ENABLER_FREEZE_BODIES:
|
|
|
|
.. _class_VisibilityEnabler_constant_ENABLER_MAX:
|
|
|
|
enum **Enabler**:
|
|
|
|
- **ENABLER_PAUSE_ANIMATIONS** = **0** --- This enabler will pause :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
|
|
|
|
- **ENABLER_FREEZE_BODIES** = **1** --- This enabler will freeze :ref:`RigidBody<class_RigidBody>` nodes.
|
|
|
|
- **ENABLER_MAX** = **2** --- Represents the size of the :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enum.
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_VisibilityEnabler_property_freeze_bodies:
|
|
|
|
- :ref:`bool<class_bool>` **freeze_bodies**
|
|
|
|
+-----------+----------------------+
|
|
| *Default* | ``true`` |
|
|
+-----------+----------------------+
|
|
| *Setter* | set_enabler(value) |
|
|
+-----------+----------------------+
|
|
| *Getter* | is_enabler_enabled() |
|
|
+-----------+----------------------+
|
|
|
|
If ``true``, :ref:`RigidBody<class_RigidBody>` nodes will be paused.
|
|
|
|
----
|
|
|
|
.. _class_VisibilityEnabler_property_pause_animations:
|
|
|
|
- :ref:`bool<class_bool>` **pause_animations**
|
|
|
|
+-----------+----------------------+
|
|
| *Default* | ``true`` |
|
|
+-----------+----------------------+
|
|
| *Setter* | set_enabler(value) |
|
|
+-----------+----------------------+
|
|
| *Getter* | is_enabler_enabled() |
|
|
+-----------+----------------------+
|
|
|
|
If ``true``, :ref:`AnimationPlayer<class_AnimationPlayer>` nodes will be paused.
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_VisibilityEnabler_method_is_enabler_enabled:
|
|
|
|
- :ref:`bool<class_bool>` **is_enabler_enabled** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler **)** const
|
|
|
|
Returns whether the enabler identified by given :ref:`Enabler<enum_VisibilityEnabler_Enabler>` constant is active.
|
|
|
|
----
|
|
|
|
.. _class_VisibilityEnabler_method_set_enabler:
|
|
|
|
- void **set_enabler** **(** :ref:`Enabler<enum_VisibilityEnabler_Enabler>` enabler, :ref:`bool<class_bool>` enabled **)**
|
|
|
|
Sets active state of the enabler identified by given :ref:`Enabler<enum_VisibilityEnabler_Enabler>` constant.
|
|
|