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