Dev Package
I will try and be upfront and helpful. I am not really a guru, and I did not go to school for these kinds of things. I am 48 and have taken an interest in game development for over 20 years. I have been working on this project for about 1.5 years, and I chased down most of the main bugs.
What I want for this page is to distribute a tool for people that want to work with a transparent window and give them a guide to work with it. It is for Unity and Windows standalone only.
I am not rich, I am not a scammer, and I do not have some pyramid scheme or anything malicious planned. My income is less than minimum wage. I live in a small 150 sq. foot trailer with no running water on my dad's property.
It is fully compliant with the law, but you are supposed to include the licenses of packages I used in it even though it is free for commercial use. I can give you that file.
If your new to game dev it is pretty easy if you stay in the Unity environment and leave default settings. You get better at this stuff as you go, so just take it slow at first until stuff sinks in a bit.
It works with Unity 6.3.8f1 URP and probably other versions. It is fully transparent and covers the whole screen.
The clickthrough is controlled in real time through any Unity collider, 2D, 3D, or UI. Clickthrough colliders can be put on Ignore Raycast if you do not want them to block. They can move in real time to be animated click blockers. They can even not click block but still receive other events.
It has a system wide audio beat/energy system, toast system, system tray functionality, screenshot functionality, fullscreen cutout, and a global Input hotkey system. It is fast and works with other windows of its kind seamlessly.
There are some caveats. If you make interop calls to Windows, you should use a delay of about 0.2s or else it may disrupt Unity's input system with a raw input window handle not found error. You should space them out with my own interop calls also.
I am not sure what Windows calls will cause the window handle to be unreadable for a bit, but minimize may be one of them. That brings me to another small glitch: if you minimize it, on restore it will flash a title bar for a few frames. My way of working around this is to leave it as an always on top window. You have full control of clickthrough anyway.
I recommend keeping it always on top only. There is a Windows compositor glitch if it ever gets behind a top-level regular window. The glitch will cause little squares and half page presents when scrolling sometimes. This is another reason it is always on top.
Minimize works to stop the compositor glitch, but causes that title bar flash. If you opt for a taskbar icon instead of only system tray, it will not minimize on taskbar icon click (only restore). I think it has something to do with stripping the menu bar. I like system tray only myself.
If two windows are made with this package, it does not matter whose is on top for clickthrough transparent areas for collider raycast events. That means one person could use a mouse over area on the middle left and someone else on the middle right as long as a collider does not block it.
It is encouraged to bring your window to front when it comes out of hiding and not call it to the front constantly so that it works well with others, because it can draw on top of other stuff.
What I would do is just leave everything default and let it be a full screen non-invasive window. You can hardly tell it is there anyway.
It is always on top only, system tray only, and with no minimize calls by default. If you do no interop calls, it is all pretty easy.
I know I probably made some mistakes and some people that know the stuff better could have done it better. Although I tested it as I went and it seems to work well and is fast!
I will plan on upgrading it (bugs, morphs, pixel engine) in the future. But this may come later, after my other project.
I also will try to put up some decent coaching articles for anyone wanting to start a dev project.
If you want to chat about it I can try to help through the Discord server I made: TransparentWindowDev
To be continued...