From 46f65f9d793d3ef59dee9bc4fd99a3b7f6845242 Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 12 Jan 2022 01:23:04 +0100 Subject: [PATCH] Improve description of mouse_exited signal (cherry picked from commit 4eec0032ea30dc3b61b9d0b623aa89bcdc40df21) --- doc/classes/Control.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index a4b41906a62..bf93b7814c1 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -893,6 +893,12 @@ Emitted when the mouse leaves the control's [code]Rect[/code] area, provided its [member mouse_filter] lets the event reach it. [b]Note:[/b] [signal mouse_exited] will be emitted if the mouse enters a child [Control] node, even if the mouse cursor is still inside the parent's [code]Rect[/code] area. + If you want to check whether the mouse truly left the area, ignoring any top nodes, you can use code like this: + [codeblock] + func _on_mouse_exited(): + if not Rect2(Vector2(), rect_size).has_point(get_local_mouse_position()): + # Not hovering over area. + [/codeblock]