mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
101 lines
2.9 KiB
ReStructuredText
101 lines
2.9 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the VisibilityNotifier2D.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_VisibilityNotifier2D:
|
|
|
|
VisibilityNotifier2D
|
|
====================
|
|
|
|
**Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
**Inherited By:** :ref:`VisibilityEnabler2D<class_VisibilityEnabler2D>`
|
|
|
|
**Category:** Core
|
|
|
|
Brief Description
|
|
-----------------
|
|
|
|
Detects when the node is visible on screen.
|
|
|
|
Properties
|
|
----------
|
|
|
|
+---------------------------+-------------------------------------------------------+
|
|
| :ref:`Rect2<class_Rect2>` | :ref:`rect<class_VisibilityNotifier2D_property_rect>` |
|
|
+---------------------------+-------------------------------------------------------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+-------------------------+---------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_on_screen<class_VisibilityNotifier2D_method_is_on_screen>` **(** **)** const |
|
|
+-------------------------+---------------------------------------------------------------------------------------+
|
|
|
|
Signals
|
|
-------
|
|
|
|
.. _class_VisibilityNotifier2D_signal_screen_entered:
|
|
|
|
- **screen_entered** **(** **)**
|
|
|
|
Emitted when the VisibilityNotifier2D enters the screen.
|
|
|
|
----
|
|
|
|
.. _class_VisibilityNotifier2D_signal_screen_exited:
|
|
|
|
- **screen_exited** **(** **)**
|
|
|
|
Emitted when the VisibilityNotifier2D exits the screen.
|
|
|
|
----
|
|
|
|
.. _class_VisibilityNotifier2D_signal_viewport_entered:
|
|
|
|
- **viewport_entered** **(** :ref:`Viewport<class_Viewport>` viewport **)**
|
|
|
|
Emitted when the VisibilityNotifier2D enters a :ref:`Viewport<class_Viewport>`'s view.
|
|
|
|
----
|
|
|
|
.. _class_VisibilityNotifier2D_signal_viewport_exited:
|
|
|
|
- **viewport_exited** **(** :ref:`Viewport<class_Viewport>` viewport **)**
|
|
|
|
Emitted when the VisibilityNotifier2D exits a :ref:`Viewport<class_Viewport>`'s view.
|
|
|
|
Description
|
|
-----------
|
|
|
|
The VisibilityNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport.
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_VisibilityNotifier2D_property_rect:
|
|
|
|
- :ref:`Rect2<class_Rect2>` **rect**
|
|
|
|
+----------+-----------------+
|
|
| *Setter* | set_rect(value) |
|
|
+----------+-----------------+
|
|
| *Getter* | get_rect() |
|
|
+----------+-----------------+
|
|
|
|
The VisibilityNotifier2D's bounding rectangle.
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_VisibilityNotifier2D_method_is_on_screen:
|
|
|
|
- :ref:`bool<class_bool>` **is_on_screen** **(** **)** const
|
|
|
|
If ``true``, the bounding rectangle is on the screen.
|
|
|
|
Note: It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return ``false`` right after it is instantiated, even if it will be on screen in the draw pass.
|
|
|