bevy_debug_panel

Crates.iobevy_debug_panel
lib.rsbevy_debug_panel
version
sourcesrc
created_at2024-08-06 20:38:34.608229
updated_at2024-11-30 11:29:11.234525
descriptionshow debug info to panel
homepage
repositoryhttps://github.com/alexniver/bevy_debug_panel
max_upload_size
id1327699
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`
size0
(alexniver)

documentation

https://docs.rs/bevy_debug_panel

README

bevy_debug_panel

add debug info to screen

examples

Quickstart

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));
    }
}

compatible bevy versions

bevy bevy_debug_panel
0.14 0.14
0.15 0.15
Commit count: 8

cargo fmt