4 releases

new 0.15.0 Nov 30, 2024
0.14.2 Aug 6, 2024
0.14.1 Aug 6, 2024
0.14.0 Aug 6, 2024

#608 in Game dev

Download history 4/week @ 2024-09-20 4/week @ 2024-09-27 1/week @ 2024-10-04 11/week @ 2024-11-01 4/week @ 2024-11-08 123/week @ 2024-11-29

130 downloads per month

MIT/Apache

32KB
103 lines

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

Dependencies

~53–86MB
~1.5M SLoC