-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental support for windows with per-pixel transparency. #14622
Conversation
|
@MarianoGnu Works with multiple monitors (Tested with two monitors on macOS and Windows). I don't know any way to get monitor where mouse is in directly and get resolution, but it is possible to get current monitor using OS::get_screen_position(int p_screen) and OS::get_screen_size(int p_screen). |
so |
Relative to main monitor.
Yes. |
NICE!! :D |
25111f2
to
c1baef7
Compare
Update: added X11 support. |
3392c81
to
a849859
Compare
Thanks a lot for your contribution! Moving this PR to the 3.1 milestone, to be reviewed once the release freeze is lifted. It could eventually be cherry-picked for a future 3.0.1 maintenance release if it doesn't change the user-facing APIs and doesn't compromise the engine's stability. |
a849859
to
d9a6c46
Compare
d9a6c46
to
f142704
Compare
For UWP, I guess you already checked that: |
cb47012
to
c5f8cdb
Compare
c5f8cdb
to
397ad84
Compare
…X11 and Windows).
397ad84
to
ddae098
Compare
Bump |
X11 code looks good. |
You have to set |
Names of the settings were changed in #26087. Open Project Setting and make sure that “display > window > per pixel transparency > allowed” and “display > window > per pixel transparency > splash” are selected. |
There's no If it is project created before #26087, make sure it's one under Then you can use |
Here's minimal test project with up to date settings - tranp.zip |
Which Godot version are you using? |
Im using Godot_v3.0.6-stable_win64 |
Per-pixel transparency is 3.1 feature, it's not available in 3.0. |
Where can i find the 3.1 version? |
It's not released, latest beta is available at https://godotengine.org/article/dev-snapshot-godot-3-1-beta-8 |
So it not possible to have transparency and the OS borders? I've tried this: func _ready():
OS.window_per_pixel_transparency_enabled = true
get_tree().get_root().set_transparent_background(true)
OS.window_borderless = false # Black instead of transparent |
+1 having the same issue @bruvzg , any updates on this? |
Supports:
NSOpenGLCPSurfaceOpacity
)UpdateLayeredWindow
)XVisualInfo
with alpha)New APIs:
Project setting
display/window/allow_per_pixel_transparency
(default value: false) - enables per-pixel transparency support (this should be enabled in project settings and can't be changed at runtime)Project setting
display/window/per_pixel_transparency
(default value: false) - sets initial window transparency stateProject setting
display/window/per_pixel_transparency_splash
(default value: false) - sets splash screen transparency state (set boot splash to custom .png with alpha channel)bool OS::window_per_pixel_transparency_enabled
propertyEnables/Disables per pixel transparency, when transparency is enabled window mode is switched to borderless.
Usage:
window/allow_per_pixel_transparency = true
in project settings.OS.window_per_pixel_transparency_enabled = true
ordisplay/window/per_pixel_transparency
project setting to enable transparency.get_tree().get_root().set_transparent_background(true)
, or changeEnvironment->Default Clear Color
alpha value.Video:
https://streamable.com/ukpxq
Screenshots:
macOS
Windows 10
Linux/X11
Demo:
physics_platformer_transp.zip (Updated)
Note:
I have removed
get_absolute_mouse_position
API from this PR since it was buggy on some Linux distros and there's more advanced and convenient PR for window movement/resizing: #16512Here's its code if someone needs it
Fixes #18009, and partially #6511