2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-02-14 14:18:53 +01:00
<class name= "VisibleOnScreenNotifier2D" inherits= "Node2D" version= "4.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 22:42:36 +02:00
<brief_description >
2021-06-15 22:33:24 +02:00
Detects when the node extents are visible on screen.
2017-09-12 22:42:36 +02:00
</brief_description>
<description >
2021-06-17 02:52:30 +02:00
The VisibleOnScreenNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport.
If you want nodes to be disabled automatically when they exit the screen, use [VisibleOnScreenEnabler2D] instead.
2017-09-12 22:42:36 +02:00
</description>
<tutorials >
2020-10-01 10:34:47 +02:00
<link title= "2D Dodge The Creeps Demo" > https://godotengine.org/asset-library/asset/515</link>
2017-09-12 22:42:36 +02:00
</tutorials>
<methods >
<method name= "is_on_screen" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2017-09-12 22:42:36 +02:00
<description >
2018-12-20 13:46:54 +01:00
If [code]true[/code], the bounding rectangle is on the screen.
2019-06-22 01:04:47 +02:00
[b]Note:[/b] It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return [code]false[/code] right after it is instantiated, even if it will be on screen in the draw pass.
2017-09-12 22:42:36 +02:00
</description>
</method>
</methods>
<members >
2019-09-24 19:45:03 +02:00
<member name= "rect" type= "Rect2" setter= "set_rect" getter= "get_rect" default= "Rect2(-10, -10, 20, 20)" >
2021-06-17 02:52:30 +02:00
The VisibleOnScreenNotifier2D's bounding rectangle.
2017-09-12 22:42:36 +02:00
</member>
</members>
<signals >
<signal name= "screen_entered" >
<description >
2021-06-17 02:52:30 +02:00
Emitted when the VisibleOnScreenNotifier2D enters the screen.
2017-09-12 22:42:36 +02:00
</description>
</signal>
<signal name= "screen_exited" >
<description >
2021-06-17 02:52:30 +02:00
Emitted when the VisibleOnScreenNotifier2D exits the screen.
2017-09-12 22:42:36 +02:00
</description>
</signal>
</signals>
</class>