godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.75k stars 21.12k forks source link

Adding custom OS Theme to your game (windowed only) #6511

Closed ivanskodje closed 5 years ago

ivanskodje commented 8 years ago

If you are creating a game, or perhaps more likely game tool (perhaps a "Battle.net" type of app for your game); it would be highly relevant to add the customization option that will give you the ability to change the window theme.

Currently, you can remove the window altogether; and kinda fake "your own window theme", but it is not possible (to my knowledge) to add transparency in the background in order to design your own. You would also have to find a way to move the window yourself. (I have not tried this yet, so I cant say for sure if this is even possible right now)

I would love to see window theme customization implemented; or at least supported (so it would be up to us to do the hard work). Some day, perhaps. :)

This is how the default Windows 8 Theme make your window (which is windowed) look like:

Here are a few good examples of custom window themes that blends with the game; Battle.net

League of Legends

SuperUserNameMan commented 8 years ago

I don't know if it changed with recent Windows versions, but in a not so far past, the "custom window border theme" of an application was drawn by the application itself.

This kind of application used a borderless window inside of which they drawn their own borders, tittle bar and buttons, and handled the resizing by themselve too.

Into the project settings, you could enable the Display / borderless_window option.

ivanskodje commented 8 years ago

To my knowledge there is no way to add transparency in the background (so you see your computer desktop); so you are limited to a perfectly square window, no?

SuperUserNameMan commented 8 years ago

yes, rectangle opaque window only.

from the not so far past i was talking about, transparent window background would require that Godot setup opengl to render into a "device independent bitmap" (which is a Win32 internal picture format) and to do some over complicated stuff to draw this bitmap into the transparent window client. It would be slow.

edit : here is a demo of someone rendering opengl with a transparent window : http://www.dhpoware.com/demos/glLayeredWindows.html

ghost commented 6 years ago

Still reproducible/relevant in 3.1 master 9ad1800 : AFAIK there's still no way to make transparent window

bruvzg commented 6 years ago

Note: PRs for per-pixel transparency - #14622, for custom window decoration logic - #16512

Calinou commented 5 years ago

Per-pixel transparency was implemented in https://github.com/godotengine/godot/pull/14622. It's also possible to implement window controls and dragging yourself (see this tutorial), so I'll close this issue.

bruvzg commented 5 years ago

It's also possible to implement window controls and dragging yourself (see this tutorial)

This implementation is completely wrong and will not work consistently, mouse and windows gonna run out of sync quickly on any OS.

bruvzg commented 5 years ago

There's new PR for window decoration logic - #23972 (supersedes #16512).