summaryrefslogtreecommitdiff
path: root/doc/classes/DisplayServer.xml
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-09-17 12:27:06 +0200
committerGitHub <noreply@github.com>2020-09-17 12:27:06 +0200
commit377c3bb25672fb7060cbd465a698661a93290e07 (patch)
tree0271e1435459fe7d6f5ff09fe9ffc892377f4010 /doc/classes/DisplayServer.xml
parentfdfcce1c03f1c5fd1de2dc637c947a7a91e4021b (diff)
parent6a14c72b12e7cb5331d93fcc0c4dd26bef0c280b (diff)
Merge pull request #39944 from bruvzg/click-through-4
Add mouse event pass-through support for window.
Diffstat (limited to 'doc/classes/DisplayServer.xml')
-rw-r--r--doc/classes/DisplayServer.xml24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index 814c232668..28194587ab 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -901,6 +901,30 @@
<description>
</description>
</method>
+ <method name="window_set_mouse_passthrough">
+ <return type="void">
+ </return>
+ <argument index="0" name="region" type="PackedVector2Array">
+ </argument>
+ <argument index="1" name="window_id" type="int" default="0">
+ </argument>
+ <description>
+ Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
+ Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
+ [codeblock]
+ # Set region, using Path2D node.
+ DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
+
+ # Set region, using Polygon2D node.
+ DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon)
+
+ # Reset region to default.
+ DisplayServer.window_set_mouse_passthrough([])
+ [/codeblock]
+ [b]Note:[/b] On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is.
+ [b]Note:[/b] This method is implemented on Linux, macOS and Windows.
+ </description>
+ </method>
<method name="window_set_position">
<return type="void">
</return>