This crate writes Bevy diagnostics into primary window title.
Made for little bit more convenient usage of the FrameTimeDiagnosticsPlugin
Add to your Cargo.toml
rust
bevy_window_title_diagnostics = 0.1
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.spawnbundle(OrthographicCameraBundle::new2d()); commands.spawnbundle(SpriteBundle { sprite: Sprite { color: Color::CYAN, customsize: Some(Vec2::new(50.0, 50.0)), ..Default::default() }, ..default() }); }
```
Tested on bevy=0.7