Crate bevy_screen_diagnostics

Source
Expand description

§bevy_screen_diagnostics

Display bevy diagnostics on the window without any hassle.

What this can do:

  • easy frame and entity dignostics
  • add custom diagnostics
  • change display of diagnostics on the fly
  • toggle diagnostics easily

see the examples on how to do this.

§Quickstart

This adds the framerate and frametime diagnostics to your window.

use bevy::prelude::*;

use bevy_screen_diagnostics::{ScreenDiagnosticsPlugin, ScreenFrameDiagnosticsPlugin};

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(ScreenDiagnosticsPlugin::default())
        .add_plugins(ScreenFrameDiagnosticsPlugin)
        .add_systems(Startup, setup_camera)
        .run();
}

fn setup_camera(mut commands: Commands) {
    commands.spawn(Camera2d);
}

The ScreenFrameDiagnosticsPlugin is a very simple plugin

§Plugins

bevy_screen_diagnostics provides the following bevy plugins:

§Font

This crate uses bevy’s default font (a stripped version of FiraCode) through the builtin-font default feature. You can provide your own font while initialising the ScreenDiagnosticsPlugin by passing it a asset file path.

§compatible bevy versions

bevybevy_screen_diagnostics
0.160.8.1
0.150.7
0.140.6
0.130.5
0.120.4
0.110.3
0.100.2
0.90.1

Structs§

DiagnosticsTextBuilder
Builder-like interface for a [DiagnosticsText].
ScreenDiagnostics
Resource which maps the name to the DiagnosticPath, Aggregate and [ConvertFn]
ScreenDiagnosticsPlugin
Plugin for displaying Diagnostics on screen.
ScreenEntityDiagnosticsPlugin
Plugin which adds the bevy EntityCountDiagnosticsPlugin and adds its diagnostics to [DiagnosticsText]
ScreenFrameDiagnosticsPlugin
Plugin which adds the bevy FrameTimeDiagnosticsPlugin and adds its diagnostics to [DiagnosticsText]
ScreenSystemInformationDiagnosticsPlugin
Plugin which adds the bevy SystemInformationDiagnosticsPlugin and adds its diagnostics to [DiagnosticsText]. “Total” is the value of the entire machine.

Enums§

Aggregate
Aggregaes which can be used for displaying Diagnostics.

Type Aliases§

FormatFn
Type alias for the fuction used to format a diagnostic value to a string.