summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-11-22 16:22:57 +0100
committerGitHub <noreply@github.com>2021-11-22 16:22:57 +0100
commit76aa1d0a433441e9bd863e1f489e9905c545f630 (patch)
treea5b299f1bd5bbeee6bf717ae5a02f28977f04af5 /scene/main
parent8daf0cc49c4bab8dd039ced214e527b21708661e (diff)
parenteabf8f5edf6dc3346bd6a6e771e382f1a20a5c29 (diff)
Merge pull request #55151 from Chaosus/control_reset_size
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/window.cpp5
-rw-r--r--scene/main/window.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index 5da5a183f7..20f8b30dc6 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -88,6 +88,10 @@ Size2i Window::get_size() const {
return size;
}
+void Window::reset_size() {
+ set_size(Size2i());
+}
+
Size2i Window::get_real_size() const {
if (window_id != DisplayServer::INVALID_WINDOW_ID) {
return DisplayServer::get_singleton()->window_get_real_size(window_id);
@@ -1410,6 +1414,7 @@ void Window::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_size", "size"), &Window::set_size);
ClassDB::bind_method(D_METHOD("get_size"), &Window::get_size);
+ ClassDB::bind_method(D_METHOD("reset_size"), &Window::reset_size);
ClassDB::bind_method(D_METHOD("get_real_size"), &Window::get_real_size);
diff --git a/scene/main/window.h b/scene/main/window.h
index def6eab7b8..0b1075ff76 100644
--- a/scene/main/window.h
+++ b/scene/main/window.h
@@ -178,6 +178,7 @@ public:
void set_size(const Size2i &p_size);
Size2i get_size() const;
+ void reset_size();
Size2i get_real_size() const;