0 votes

Background is still not transparent, but the boot splash really disappeared.
https://imgur.com/iMHTe9L

Godot version 3.3.2
related to an answer for: Any way to create desktop app/game?
in Engine by (20 points)

1 Answer

+2 votes
Best answer

Transparency might still be disabled? In your scripts _ready() function, try putting:
get_tree().get_root().set_transparent_background(true)

And make sure that your WorldEnvironment background color has an Alpha of 0.
WorldEnvironment > Ambient Light > Color → # 00000000

by (992 points)
selected by

Thnx, it's works, but, there is also the questions:
- Of whether it is possible to pass inputs to the desktop, for example, if the cursor is on a button, then the input goes into the game, and if it does not touch any object, the input goes to the desktop;
- Or, the game will be behind the desktop and all inputs will be sent to it only when nothing already covers it.

Of whether it is possible to pass inputs to the desktop

In its basic form, due to the nature of the computer OS, there is no way the mouse cursor input can pass through the game window on to the desktop.

So, what you would need for this is multiple game windows. Godot unfortunately doesn't support this for now...

But I think you can make your game — it is just much more complex.

Basically my idea is that: you would need to make multiple "games" that all serve as buttons etc. for the main 'game' that you are trying to make (this is just so you could separate them from each other).

They would communicate to each other through files in the filesystem that contain various data (maybe they are constantly reloading the same text files from the other games, looking for any changes and if they see a change they will act themselves).

See this for more details on files:
https://docs.godotengine.org/en/stable/classes/class_file.html

This would allow you to have desktop-clickable space between the game elements, because the user is not clicking on any game windows.
I think that's probably (one of) the only ways to do it for right now.

inputs will be sent to it only when nothing already covers it

This is hard as well, again due to the nature of every Operating System. It's possible to make a program window "Always On Top" but not "Always On Bottom". You can detect when the window loses or gains focus (the user clicks away or clicks o the window, respectively), there's also various other Window Management detections, but whether you can do anything useful for them with what you want is debatable.

In general it's hard (impossible) to prevent a user from forcing the system to gain focus on a window if they really want to. Is there much benefit to preventing this from happening?

A further note regarding Windows, if the user wants to play your desktop game (which would seem to be like a Vista widget), they would likely want to press the Show Desktop button (lower-right). This would force your game to minimize (and the Desktop window to become focused), so you would have to consider this aspect as well.


Note that it is possible to work around all of the above issues if you write a system-specific application (using Visual Studio or something like that), and it may potentially be faster or more efficient than attempting to make such an application with Godot.

And thinking about a hybrid may be able to combine a game system you've created with Godot and a window management program you created with some other software. But I have no experience with any of that so I wouldn't be able to point you in any direction to make a start.
It's just food for thought.

Hope it helps!

Thanks for the help and idea, I'll go and think what I can do.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.