diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2021-11-20 11:04:57 +0300 |
---|---|---|
committer | Yuri Roubinsky <chaosus89@gmail.com> | 2021-11-22 16:55:21 +0300 |
commit | eabf8f5edf6dc3346bd6a6e771e382f1a20a5c29 (patch) | |
tree | c0f181a442d43239b10e2379916df83c9f34e820 /scene/main | |
parent | ed02b8af59fceb48798c857306335fe0f7ff6a8a (diff) |
Added `reset_size` method to `Control` and `Window` classes
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/window.cpp | 5 | ||||
-rw-r--r-- | scene/main/window.h | 1 |
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; |