| Crates.io | bevy_window_utils |
| lib.rs | bevy_window_utils |
| version | 0.16.0 |
| created_at | 2025-04-14 13:32:47.02571+00 |
| updated_at | 2025-04-27 06:16:31.693927+00 |
| description | A library for window utils such as managing window icon and taskbar progress indicator in Bevy. |
| homepage | |
| repository | https://github.com/shwwwa/bevy_window_utils |
| max_upload_size | |
| id | 1632812 |
| size | 118,651 |
A simple crate with utilities such as setting the window icon and taskbar progress indicator. Supports linux and windows. (macOS?) Has only needed bevy/winit dependencies, depends on winsafe/winit crate (exposes winsafe/winit functions). Supports embedded assets and other bevy plugins.
Compatible with Bevy 0.16.0 (as of 0.16.0)
Modifying taskbar progress indicator is only supported on windows 7+ and requires the taskbar feature.
Example usage:
use bevy::prelude::*;
use bevy_window_utils::{WindowUtils, WindowUtilsPlugin};
fn main() {
let mut app = App::new();
// You can initialize icon instead of default.
app.add_plugins((DefaultPlugins, WindowUtilsPlugin::default()))
.add_systems(
Startup,
|assets: Res<AssetServer>, mut window: ResMut<WindowUtils>| {
// You can set icon on runtime:
window.window_icon = Some(assets.load("icon.png"));
window.taskbar_progress = Some(bevy_window_utils::TaskbarProgress {
progress: 30,
..Default::default()
});
},
)
.add_systems(Update, |mut window: ResMut<WindowUtils>| {
window.taskbar_progress =
window
.taskbar_progress
.as_ref()
.map(|p| bevy_window_utils::TaskbarProgress {
progress: p.progress + 1,
..Default::default()
});
});
app.run();
}