This should be possible mostly out of the box once bevy 0.10 releases (Should release possibly as early as next week). 0.10.0 adds support for disabling hittest for input passthrough. Transparent windows are already supported.
let window_descriptor = WindowDescriptor {
// Enable transparent support for the window
transparent: true,
decorations: false,
always_on_top: true,
// Allows inputs to pass through to apps behind this app. New to bevy 0.10
hittest: false,
width: 800.0,
height: 600.0,
..default()
};
App::new()
// Make it render background as transparent
.insert_resource(ClearColor(Color::NONE))
.add_plugins(DefaultPlugins.set(WindowPlugin {
window: window_descriptor,
..default()
}))
You will probably want to use https://crates.io/crates/bevy_global_input to get input while the window isn't focused as bevy doesn't support that out of the box.
If you want to use bevy 0.9 the guy that contributed the changes for this has a 0.9 branch with the changes applied here: https://github.com/laundmo/bevy/tree/bevy_0.9_overlay
Here's an example where I did this for a weekend project: https://mastodon.gamedev.place/@paul/109604847674290795
Some helpful discussion on the discord thread for that project too:
https://discord.com/channels/691052431525675048/692648638823923732/1058481406730317907