Skip to content

Commit 8c729f0

Browse files
authored
Merge pull request #76646 from KoBeWi/acoording_to_screen
Some clarifications on screen-space coordinates
2 parents ba32279 + 33b9be2 commit 8c729f0

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

doc/classes/CanvasItem.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@
423423
<return type="Vector2" />
424424
<description>
425425
Returns the mouse's position in the [CanvasLayer] that this [CanvasItem] is in using the coordinate system of the [CanvasLayer].
426+
[b]Note:[/b] For screen-space coordinates (e.g. when using a non-embedded [Popup]), you can use [method DisplayServer.mouse_get_position].
426427
</description>
427428
</method>
428429
<method name="get_global_transform" qualifiers="const">

doc/classes/DisplayServer.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@
821821
<method name="mouse_get_position" qualifiers="const">
822822
<return type="Vector2i" />
823823
<description>
824-
Returns the mouse cursor's current position.
824+
Returns the mouse cursor's current position in screen coordinates.
825825
</description>
826826
</method>
827827
<method name="mouse_set_mode">

doc/classes/Window.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@
563563
</member>
564564
<member name="position" type="Vector2i" setter="set_position" getter="get_position" default="Vector2i(0, 0)">
565565
The window's position in pixels.
566+
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].
566567
</member>
567568
<member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i(100, 100)">
568569
The window's size in pixels.

0 commit comments

Comments
 (0)