summaryrefslogtreecommitdiff
path: root/doc/classes/DisplayServer.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/DisplayServer.xml')
-rw-r--r--doc/classes/DisplayServer.xml36
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index 814c232668..53776b7752 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -521,6 +521,18 @@
<argument index="0" name="screen" type="int" default="-1">
</argument>
<description>
+ Returns the dots per inch density of the specified screen. If [code]screen[/code] is [/code]SCREEN_OF_MAIN_WINDOW[/code] (the default value), a screen with the main window will be used.
+ [b]Note:[/b] On macOS, returned value is inaccurate if fractional display scaling mode is used.
+ [b]Note:[/b] On Android devices, the actual screen densities are grouped into six generalized densities:
+ [codeblock]
+ ldpi - 120 dpi
+ mdpi - 160 dpi
+ hdpi - 240 dpi
+ xhdpi - 320 dpi
+ xxhdpi - 480 dpi
+ xxxhdpi - 640 dpi
+ [/codeblock]
+ [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. Returns [code]72[/code] on unsupported platforms.
</description>
</method>
<method name="screen_get_max_scale" qualifiers="const">
@@ -901,6 +913,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>