Skip to content

Commit

Permalink
Merge pull request #76646 from KoBeWi/acoording_to_screen
Browse files Browse the repository at this point in the history
Some clarifications on screen-space coordinates
  • Loading branch information
mhilbrunner authored May 3, 2023
2 parents ba32279 + 33b9be2 commit 8c729f0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/classes/CanvasItem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@
<return type="Vector2" />
<description>
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].
</description>
</method>
<method name="get_global_transform" qualifiers="const">
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/DisplayServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@
<method name="mouse_get_position" qualifiers="const">
<return type="Vector2i" />
<description>
Returns the mouse cursor's current position.
Returns the mouse cursor's current position in screen coordinates.
</description>
</method>
<method name="mouse_set_mode">
Expand Down
1 change: 1 addition & 0 deletions doc/classes/Window.xml
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@
</member>
<member name="position" type="Vector2i" setter="set_position" getter="get_position" default="Vector2i(0, 0)">
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].
</member>
<member name="size" type="Vector2i" setter="set_size" getter="get_size" default="Vector2i(100, 100)">
The window's size in pixels.
Expand Down

0 comments on commit 8c729f0

Please sign in to comment.