diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-01-15 12:05:25 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-01-16 11:42:49 +0200 |
commit | 34b34b104cd25c0e36b09ff2c666c3e64719f262 (patch) | |
tree | 217afb83e7cfce5f10e07c5824062c2242a105ee /doc/classes/Window.xml | |
parent | 0f0b853c988f2c3ff322d8eaf97dd4f8d5de46c8 (diff) |
Add `WINDOW_FLAG_MOUSE_PASSTHROUGH` flag and enabled it for tooltips. Expose `window_set_mouse_passthrough` to `Window`.
Diffstat (limited to 'doc/classes/Window.xml')
-rw-r--r-- | doc/classes/Window.xml | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index 4cd6cf41da..dd145c016c 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -527,6 +527,39 @@ Set's the window's current mode. [b]Note:[/b] Fullscreen mode is not exclusive full screen on Windows and Linux. </member> + <member name="mouse_passthrough" type="bool" setter="set_flag" getter="get_flag" default="false"> + If [code]true[/code], all mouse event as passed to the underlying window of the same application. See also [member mouse_passthrough_polygon]. + [b]Note:[/b] This property is implemented on Linux (X11), macOS and Windows. + </member> + <member name="mouse_passthrough_polygon" type="PackedVector2Array" setter="set_mouse_passthrough_polygon" getter="get_mouse_passthrough_polygon" default="PackedVector2Array()"> + 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). + [codeblocks] + [gdscript] + # Set region, using Path2D node. + $Window.mouse_passthrough_polygon = $Path2D.curve.get_baked_points() + + # Set region, using Polygon2D node. + $Window.mouse_passthrough_polygon = $Polygon2D.polygon + + # Reset region to default. + $Window.mouse_passthrough_polygon = [] + [/gdscript] + [csharp] + // Set region, using Path2D node. + GetNode<Window>("Window").MousePassthrough = GetNode<Path2D>("Path2D").Curve.GetBakedPoints(); + + // Set region, using Polygon2D node. + GetNode<Window>("Window").MousePassthrough = GetNode<Polygon2D>("Polygon2D").Polygon; + + // Reset region to default. + GetNode<Window>("Window").MousePassthrough = new Vector2[] {}; + [/csharp] + [/codeblocks] + [b]Note:[/b] This property is ignored if [member mouse_passthrough] is set to [code]true[/code]. + [b]Note:[/b] On Windows, the portion of a window that lies outside the region is not drawn, while on Linux (X11) and macOS it is. + [b]Note:[/b] This property is implemented on Linux (X11), macOS and Windows. + </member> <member name="popup_window" type="bool" setter="set_flag" getter="get_flag" default="false"> If [code]true[/code], the [Window] will be considered a popup. Popups are sub-windows that don't show as separate windows in system's window manager's window list and will send close request when anything is clicked outside of them (unless [member exclusive] is enabled). </member> @@ -695,7 +728,9 @@ Window content is expanded to the full size of the window. Unlike borderless window, the frame is left intact and can be used to resize the window, title bar is transparent, but have minimize/maximize/close buttons. Set with [member extend_to_title]. [b]Note:[/b] This flag is implemented on macOS. </constant> - <constant name="FLAG_MAX" value="7" enum="Flags"> + <constant name="FLAG_MOUSE_PASSTHROUGH" value="7" enum="Flags"> + </constant> + <constant name="FLAG_MAX" value="8" enum="Flags"> Max value of the [enum Flags]. </constant> <constant name="CONTENT_SCALE_MODE_DISABLED" value="0" enum="ContentScaleMode"> |