Crates.io | bevy_debug_panel |
lib.rs | bevy_debug_panel |
version | |
source | src |
created_at | 2024-08-06 20:38:34.608229 |
updated_at | 2024-11-30 11:29:11.234525 |
description | show debug info to panel |
homepage | |
repository | https://github.com/alexniver/bevy_debug_panel |
max_upload_size | |
id | 1327699 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
add debug info to screen
simple show framerate example
use bevy::diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin};
use bevy::prelude::*;
use bevy_debug_panel::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(DebugPanelPlugin)
.add_plugins(FrameTimeDiagnosticsPlugin)
.add_systems(Startup, setup)
.add_systems(Update, show_fps)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn(Camera2dBundle { ..default() });
}
fn show_fps(diagnostics: Res<DiagnosticsStore>, mut debug_res: ResMut<DebugResource>) {
if let Some(value) = diagnostics
.get(&FrameTimeDiagnosticsPlugin::FPS)
.and_then(|fps| fps.smoothed())
{
debug_res.insert("Fps", format!("{:.2}", value));
}
}
bevy | bevy_debug_panel |
---|---|
0.14 | 0.14 |
0.15 | 0.15 |