From 39e49a8bdd436f0c8a9bf41148b325be6e4b9be1 Mon Sep 17 00:00:00 2001
From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com>
Date: Sat, 15 Oct 2022 21:02:58 +0200
Subject: [PATCH] Expose Viewport::get_screen_transform to GDScript
---
doc/classes/Viewport.xml | 6 ++++++
scene/main/viewport.cpp | 1 +
2 files changed, 7 insertions(+)
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index 998e7829753..fce94fe567e 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -71,6 +71,12 @@
+
+
+
+ Returns the transform from the Viewport's coordinates to the screen coordinates of the containing window manager window.
+
+
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index f66337a2f95..a2963eadd52 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -3729,6 +3729,7 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_global_canvas_transform", "xform"), &Viewport::set_global_canvas_transform);
ClassDB::bind_method(D_METHOD("get_global_canvas_transform"), &Viewport::get_global_canvas_transform);
ClassDB::bind_method(D_METHOD("get_final_transform"), &Viewport::get_final_transform);
+ ClassDB::bind_method(D_METHOD("get_screen_transform"), &Viewport::get_screen_transform);
ClassDB::bind_method(D_METHOD("get_visible_rect"), &Viewport::get_visible_rect);
ClassDB::bind_method(D_METHOD("set_transparent_background", "enable"), &Viewport::set_transparent_background);