This crate writes Bevy diagnostics into primary window title.
Made for little bit more convenient usage of the FrameTimeDiagnosticsPlugin
Add to your Cargo.toml
For bevy 0.10: ```rust bevywindowtitle_diagnostics = 0.4
```
Just add WindowTitleLoggerDiagnosticsPlugin
from this crate alongside with default FrameTimeDiagnosticsPlugin
```rust use bevy::diagnostic::FrameTimeDiagnosticsPlugin; use bevy::prelude::*; use bevywindowtitle_diagnostics::WindowTitleLoggerDiagnosticsPlugin;
fn main() { App::new() .addplugins(DefaultPlugins) .addstartupsystem(setup) .addplugin(FrameTimeDiagnosticsPlugin) // Insert same way as usual LogDiagnosticsPlugin .addplugin(WindowTitleLoggerDiagnosticsPlugin { // It is possible to filter Diagnostics same way as default LogDiagnosticsPlugin // filter: Some(vec![FrameTimeDiagnosticsPlugin::FPS]), ..Default::default() }) // Works with any diagnostics // .addplugin(bevy::diagnostic::EntityCountDiagnosticsPlugin::default()) .run(); }
fn setup(mut commands: Commands) { commands.spawn(Camera2dBundle::newwithfar(10.0)); commands.spawn(SpriteBundle { sprite: Sprite { color: Color::CYAN, custom_size: Some(Vec2::new(50.0, 50.0)), ..default() }, ..default() }); } ```
Bevy version | bevywindowtitle_diagnostics version --- | --- 0.8 | 0.2 0.9 | 0.3 0.10 | 0.4