From ddae098deec89d67228a74623ebe7f5db39f425b Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sun, 10 Dec 2017 20:38:26 +0200 Subject: Experimental support for windows with per-pixel transparency (macOS, X11 and Windows). --- core/bind/core_bind.cpp | 12 ++++++++++++ core/bind/core_bind.h | 3 +++ 2 files changed, 15 insertions(+) (limited to 'core/bind') diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 20adf7ff02..7968182149 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -332,6 +332,14 @@ void _OS::set_borderless_window(bool p_borderless) { OS::get_singleton()->set_borderless_window(p_borderless); } +bool _OS::get_window_per_pixel_transparency_enabled() const { + return OS::get_singleton()->get_window_per_pixel_transparency_enabled(); +} + +void _OS::set_window_per_pixel_transparency_enabled(bool p_enabled) { + OS::get_singleton()->set_window_per_pixel_transparency_enabled(p_enabled); +} + bool _OS::get_borderless_window() const { return OS::get_singleton()->get_borderless_window(); } @@ -1063,6 +1071,9 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("set_borderless_window", "borderless"), &_OS::set_borderless_window); ClassDB::bind_method(D_METHOD("get_borderless_window"), &_OS::get_borderless_window); + ClassDB::bind_method(D_METHOD("get_window_per_pixel_transparency_enabled"), &_OS::get_window_per_pixel_transparency_enabled); + ClassDB::bind_method(D_METHOD("set_window_per_pixel_transparency_enabled", "enabled"), &_OS::set_window_per_pixel_transparency_enabled); + ClassDB::bind_method(D_METHOD("set_ime_position", "position"), &_OS::set_ime_position); ClassDB::bind_method(D_METHOD("set_screen_orientation", "orientation"), &_OS::set_screen_orientation); @@ -1180,6 +1191,7 @@ void _OS::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "screen_orientation", PROPERTY_HINT_ENUM, "Landscape,Portrait,Reverse Landscape,Reverse Portrait,Sensor Landscape,Sensor Portrait,Sensor"), "set_screen_orientation", "get_screen_orientation"); ADD_GROUP("Window", "window_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "window_borderless"), "set_borderless_window", "get_borderless_window"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "window_per_pixel_transparency_enabled"), "set_window_per_pixel_transparency_enabled", "get_window_per_pixel_transparency_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "window_fullscreen"), "set_window_fullscreen", "is_window_fullscreen"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "window_maximized"), "set_window_maximized", "is_window_maximized"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "window_minimized"), "set_window_minimized", "is_window_minimized"); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index c40abd51f6..1de05b347a 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -179,6 +179,9 @@ public: virtual void set_borderless_window(bool p_borderless); virtual bool get_borderless_window() const; + virtual bool get_window_per_pixel_transparency_enabled() const; + virtual void set_window_per_pixel_transparency_enabled(bool p_enabled); + virtual void set_ime_position(const Point2 &p_pos); Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track); -- cgit v1.2.3