From 33b9be27d39503897933726d1c5560e4ec271222 Mon Sep 17 00:00:00 2001 From: kobewi Date: Mon, 1 May 2023 13:50:34 +0200 Subject: [PATCH] Some clarifications on screen-space coordinates --- doc/classes/CanvasItem.xml | 1 + doc/classes/DisplayServer.xml | 2 +- doc/classes/Window.xml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index af1f2be76d85..95c58ddbd6bc 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -423,6 +423,7 @@ Returns the mouse's position in the [CanvasLayer] that this [CanvasItem] is in using the coordinate system of the [CanvasLayer]. + [b]Note:[/b] For screen-space coordinates (e.g. when using a non-embedded [Popup]), you can use [method DisplayServer.mouse_get_position]. diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 924e1d5d2fc6..ed9d32e881ad 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -821,7 +821,7 @@ - Returns the mouse cursor's current position. + Returns the mouse cursor's current position in screen coordinates. diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index 4cc48bd70b7c..f3f3b2dd014e 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -563,6 +563,7 @@ The window's position in pixels. + If [member ProjectSettings.display/window/subwindows/embed_subwindows] is [code]false[/code], the position is in absolute screen coordinates. This typically applies to editor plugins. If the setting is [code]false[/code], the window's position is in the coordinates of its parent [Viewport]. The window's size in pixels.