Show a transparent desktop game
Before you start
Complete Installation. Run a Win64 package or a separate Standalone Game with -DGTStandalonePreview.
Use a camera looking at a mesh or sprite with empty space around it. For sky and clouds, enable Holdout; check the fog limitation in the same section. Floors and opaque full-screen widgets can cover the desktop.
Set up startup
Create a Player Controller Blueprint, assign it in your active Game Mode > Player Controller Class, and build this flow in its Event Graph. Keep existing BeginPlay/EndPlay logic when using an existing controller.
- Add a Boolean
DesktopSetupComplete, initially false, and a custom eventTryDesktopSetup. - On BeginPlay, get the Desktop Game Window Subsystem and bind On Desktop Window Status Changed to a handler that calls
TryDesktopSetup. Then check Get Desktop Toggle Hotkey immediately. If true, reuse the existing session binding and mark setup complete without changing modes; this handles map changes. Otherwise callTryDesktopSetupimmediately. - In
TryDesktopSetup, stop if setup is complete. Check Get Desktop Window Status forInteractive,ClickThrough, orRestartRequired, then require Get Current Display to return true. Other statuses do not run setup; shutdown also emits status changes. - Call Set Desktop Toggle Hotkey: Key
Z, Ctrl true, Alt true, Shift false. Check Return Value with Switch on EDGTResult. OnlySuccesscontinues to Set Desktop Presentation Mode: Transparent. - Set
DesktopSetupCompletetrue only after presentation returnsSuccess. On either failure, read Get Last Desktop Window Error and show its message. Keep the guard false so an explicit retry can callTryDesktopSetupagain after changing the chord. - On EndPlay, unbind your own status handler. Compile and run.
Use Print String for development feedback and visible game UI for Shipping errors. Ctrl + Alt + Z is an example binding; another application may already own it.
Expected result
The game opens Opaque, then shows the desktop through clear pixels after setup succeeds. Press Ctrl + Alt + Z to toggle Interactive / ClickThrough. The shortcut does not toggle transparency.
Each new launch requires registration again. Continue with Hotkeys, window controls, or display selection.