summaryrefslogtreecommitdiffstats
path: root/doc/classes/VisibleOnScreenEnabler2D.xml
diff options
context:
space:
mode:
authorMewPurPur <mew.pur.pur@gmail.com>2023-08-29 19:07:06 +0300
committerMewPurPur <mew.pur.pur@gmail.com>2023-10-17 19:29:16 +0300
commit53d0ba2913a301563b187479270bce6b2de5f3d2 (patch)
tree381310ddbadc0d04b0654717e1cc258fa39204c4 /doc/classes/VisibleOnScreenEnabler2D.xml
parentb467afe65d826f9215f962fe7d78d6bbc1101624 (diff)
downloadredot-engine-53d0ba2913a301563b187479270bce6b2de5f3d2.tar.gz
Improve VisibleOnScreen classes docs
Diffstat (limited to 'doc/classes/VisibleOnScreenEnabler2D.xml')
-rw-r--r--doc/classes/VisibleOnScreenEnabler2D.xml10
1 files changed, 6 insertions, 4 deletions
diff --git a/doc/classes/VisibleOnScreenEnabler2D.xml b/doc/classes/VisibleOnScreenEnabler2D.xml
index 9f8b07261e..e9017a389b 100644
--- a/doc/classes/VisibleOnScreenEnabler2D.xml
+++ b/doc/classes/VisibleOnScreenEnabler2D.xml
@@ -1,19 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisibleOnScreenEnabler2D" inherits="VisibleOnScreenNotifier2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
- Automatically disables another node if not visible on screen.
+ A rectangular region of 2D space that, when visible on screen, enables a target node.
</brief_description>
<description>
- VisibleOnScreenEnabler2D detects when it is visible on screen (just like [VisibleOnScreenNotifier2D]) and automatically enables or disables the target node. The target node is disabled when [VisibleOnScreenEnabler2D] is not visible on screen (including when [member CanvasItem.visible] is [code]false[/code]), and enabled when the enabler is visible. The disabling is achieved by changing [member Node.process_mode].
+ [VisibleOnScreenEnabler2D] contains a rectangular region of 2D space and a target node. The target node will be automatically enabled (via its [member Node.process_mode] property) when any part of this region becomes visible on the screen, and automatically disabled otherwise. This can for example be used to activate enemies only when the player approaches them.
+ See [VisibleOnScreenNotifier2D] if you only want to be notified when the region is visible on screen.
+ [b]Note:[/b] [VisibleOnScreenEnabler2D] uses the render culling code to determine whether it's visible on screen, so it won't function unless [member CanvasItem.visible] is set to [code]true[/code].
</description>
<tutorials>
</tutorials>
<members>
<member name="enable_mode" type="int" setter="set_enable_mode" getter="get_enable_mode" enum="VisibleOnScreenEnabler2D.EnableMode" default="0">
- Determines how the node is enabled. Corresponds to [enum Node.ProcessMode]. Disabled node uses [constant Node.PROCESS_MODE_DISABLED].
+ Determines how the target node is enabled. Corresponds to [enum Node.ProcessMode]. When the node is disabled, it always uses [constant Node.PROCESS_MODE_DISABLED].
</member>
<member name="enable_node_path" type="NodePath" setter="set_enable_node_path" getter="get_enable_node_path" default="NodePath(&quot;..&quot;)">
- 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.
+ 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 the scene tree) and every time the [VisibleOnScreenEnabler2D] enters the scene tree. If the path is invalid, an error will be printed in the editor and no node will be affected.
</member>
</members>
<constants>