1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

Added OS::center_window to center the window precisely on desktop platforms

This commit is contained in:
marcelofg55
2017-12-02 16:48:14 -03:00
committed by Marcelo Fernandez
parent 7983fb95b0
commit 129e0f34d0
10 changed files with 62 additions and 1 deletions

View File

@@ -261,6 +261,10 @@ Size2 _OS::get_window_size() const {
return OS::get_singleton()->get_window_size();
}
Size2 _OS::get_real_window_size() const {
return OS::get_singleton()->get_real_window_size();
}
void _OS::set_window_size(const Size2 &p_size) {
OS::get_singleton()->set_window_size(p_size);
}
@@ -935,6 +939,11 @@ void _OS::request_attention() {
OS::get_singleton()->request_attention();
}
void _OS::center_window() {
OS::get_singleton()->center_window();
}
bool _OS::is_debug_build() const {
#ifdef DEBUG_ENABLED
@@ -1032,6 +1041,8 @@ void _OS::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_window_maximized", "enabled"), &_OS::set_window_maximized);
ObjectTypeDB::bind_method(_MD("is_window_maximized"), &_OS::is_window_maximized);
ObjectTypeDB::bind_method(_MD("request_attention"), &_OS::request_attention);
ObjectTypeDB::bind_method(_MD("get_real_window_size"), &_OS::get_real_window_size);
ObjectTypeDB::bind_method(_MD("center_window"), &_OS::center_window);
ObjectTypeDB::bind_method(_MD("set_borderless_window", "borderless"), &_OS::set_borderless_window);
ObjectTypeDB::bind_method(_MD("get_borderless_window"), &_OS::get_borderless_window);