:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/VisibleOnScreenEnabler2D.xml. .. _class_VisibleOnScreenEnabler2D: VisibleOnScreenEnabler2D ======================== **Inherits:** :ref:`VisibleOnScreenNotifier2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` Automatically disables another node if not visible on screen. .. rst-class:: classref-introduction-group Description ----------- VisibleOnScreenEnabler2D detects when it is visible on screen (just like :ref:`VisibleOnScreenNotifier2D`) and automatically enables or disables the target node. The target node is disabled when **VisibleOnScreenEnabler2D** is not visible on screen (including when :ref:`CanvasItem.visible` is ``false``), and enabled when the enabler is visible. The disabling is achieved by changing :ref:`Node.process_mode`. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------+ | :ref:`EnableMode` | :ref:`enable_mode` | ``0`` | +-------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------+ | :ref:`NodePath` | :ref:`enable_node_path` | ``NodePath("..")`` | +-------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_VisibleOnScreenEnabler2D_EnableMode: .. rst-class:: classref-enumeration enum **EnableMode**: .. _class_VisibleOnScreenEnabler2D_constant_ENABLE_MODE_INHERIT: .. rst-class:: classref-enumeration-constant :ref:`EnableMode` **ENABLE_MODE_INHERIT** = ``0`` Corresponds to :ref:`Node.PROCESS_MODE_INHERIT`. .. _class_VisibleOnScreenEnabler2D_constant_ENABLE_MODE_ALWAYS: .. rst-class:: classref-enumeration-constant :ref:`EnableMode` **ENABLE_MODE_ALWAYS** = ``1`` Corresponds to :ref:`Node.PROCESS_MODE_ALWAYS`. .. _class_VisibleOnScreenEnabler2D_constant_ENABLE_MODE_WHEN_PAUSED: .. rst-class:: classref-enumeration-constant :ref:`EnableMode` **ENABLE_MODE_WHEN_PAUSED** = ``2`` Corresponds to :ref:`Node.PROCESS_MODE_WHEN_PAUSED`. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_VisibleOnScreenEnabler2D_property_enable_mode: .. rst-class:: classref-property :ref:`EnableMode` **enable_mode** = ``0`` .. rst-class:: classref-property-setget - void **set_enable_mode** **(** :ref:`EnableMode` value **)** - :ref:`EnableMode` **get_enable_mode** **(** **)** Determines how the node is enabled. Corresponds to :ref:`ProcessMode`. Disabled node uses :ref:`Node.PROCESS_MODE_DISABLED`. .. rst-class:: classref-item-separator ---- .. _class_VisibleOnScreenEnabler2D_property_enable_node_path: .. rst-class:: classref-property :ref:`NodePath` **enable_node_path** = ``NodePath("..")`` .. rst-class:: classref-property-setget - void **set_enable_node_path** **(** :ref:`NodePath` value **)** - :ref:`NodePath` **get_enable_node_path** **(** **)** The path to the target node, relative to the **VisibleOnScreenEnabler2D**. The target node is cached; it's only assigned when setting this property (if the **VisibleOnScreenEnabler2D** is inside scene tree) and every time the **VisibleOnScreenEnabler2D** enters the scene tree. If the path is invalid, nothing will happen. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`