Crate iyes_perf_ui

Crate iyes_perf_ui 

Source
Expand description

Customizable Performance/Debug Overlay for Bevy UI

This crate provides an implementation of an in-game performance/debug UI overlay for the Bevy game engine.

The goal of this crate is to make it as useful as possible for any Bevy project:

  • Made with Bevy UI (not egui or any other 3rd-party UI solution)
  • Easy to set up (see simple example)
  • Modular! You decide what info you want to display!
    • Choose any combination of predefined entries (see specific_entries example):
      • Framerate (FPS), Frame Time, Frame Count, ECS Entity Count, CPU Usage, RAM Usage, Render CPU Time, Render GPU Time, Wall Clock, Running Time, Fixed Time Step, Fixed Overstep, Cursor Position, Window Resolution, Window Scale Factor, Window Mode, Present Mode
    • Implement your own custom entries to display anything you like!
  • Customizable appearance/styling (see settings, fps_minimalist examples)
  • Support for highlighting values using a custom font or color!
    • Allows you to quickly notice if something demands your attention.

First, make sure to add the plugin to your app:

app.add_plugins(PerfUiPlugin);

And then, pawning a Perf UI can be as simple as:

commands.spawn(PerfUiAllEntries::default());

If you want to create a Perf UI with specific entries of your choice, just spawn an entity with your desired entries, instead of using this bundle.

commands.spawn((
    PerfUiEntryFPS::default(),
    PerfUiEntryClock::default(),
    // ...
));

If you want to customize the appearance, set the various fields in each of the structs, instead of using default(). To customize settings that apply to all entries, add the [PerfUiRoot] component.

If you want to implement your own custom entry, create a component type to represent your entry (you can use it to store any settings), implement [PerfUiEntry] for it, and register it using app.add_perf_ui_entry_type::<T>().

Modules§

entries
Predefined entry types offered by this library.
entry
Common framework for Perf UI Entry types (data providers)
prelude
Prelude of common types for users of the library
ui
Framework for the UI hierarchy
utils
Helper functions
widgets
Predefined widget types offered by this library.

Structs§

PerfUiPlugin
The Bevy Plugin

Enums§

PerfUiSet
System Set to allow you to order things relative to our systems.

Traits§

PerfUiAppExt
Extension trait for adding new types of Perf UI Entries.