2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2021-06-17 00:52:30 +00:00
<class name= "VisibleOnScreenNotifier2D" inherits= "Node2D" version= "4.0" >
2017-09-12 20:42:36 +00:00
<brief_description >
2021-06-15 20:33:24 +00:00
Detects when the node extents are visible on screen.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2021-06-17 00:52:30 +00: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 20:42:36 +00:00
</description>
<tutorials >
2020-10-01 08:34:47 +00:00
<link title= "2D Dodge The Creeps Demo" > https://godotengine.org/asset-library/asset/515</link>
2017-09-12 20:42:36 +00:00
</tutorials>
<methods >
<method name= "is_on_screen" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "bool" />
2017-09-12 20:42:36 +00:00
<description >
2018-12-20 12:46:54 +00:00
If [code]true[/code], the bounding rectangle is on the screen.
2019-06-21 23:04:47 +00: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 20:42:36 +00:00
</description>
</method>
</methods>
<members >
2019-09-24 17:45:03 +00:00
<member name= "rect" type= "Rect2" setter= "set_rect" getter= "get_rect" default= "Rect2(-10, -10, 20, 20)" >
2021-06-17 00:52:30 +00:00
The VisibleOnScreenNotifier2D's bounding rectangle.
2017-09-12 20:42:36 +00:00
</member>
</members>
<signals >
<signal name= "screen_entered" >
<description >
2021-06-17 00:52:30 +00:00
Emitted when the VisibleOnScreenNotifier2D enters the screen.
2017-09-12 20:42:36 +00:00
</description>
</signal>
<signal name= "screen_exited" >
<description >
2021-06-17 00:52:30 +00:00
Emitted when the VisibleOnScreenNotifier2D exits the screen.
2017-09-12 20:42:36 +00:00
</description>
</signal>
</signals>
</class>