Skip to content

Commit

Permalink
basic docs
Browse files Browse the repository at this point in the history
  • Loading branch information
matiqo15 committed Mar 8, 2024
1 parent 0cdfe37 commit 7fe771d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/bevy_dev_tools/src/fps_overlay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ use bevy_text::{Text, TextSection, TextStyle};
use bevy_ui::node_bundles::TextBundle;

#[derive(Default)]
/// A plugin that adds an FPS overlay to the Bevy application.
pub struct FpsOverlayPlugin {
/// Starting configuration of overlay, this can be later be changed through `[FpsOverlayConfig]` resource.
pub config: FpsOverlayConfig,
}

Expand All @@ -30,10 +32,17 @@ impl Plugin for FpsOverlayPlugin {
}

#[derive(Resource, Clone)]
/// Configuration options for the FPS overlay.
pub struct FpsOverlayConfig {
/// File path for the font file. If set to `None`,the default font is used.
/// Note: The overlay won't be visible if you set it to `None` and run without `default_font` feature.
pub font_path: Option<String>,
/// Size of the overlay text.
pub font_size: f32,
/// Color of the overlay text.
pub font_color: Color,
/// Keybind for toggling on/off the overlay.
/// If set to none, [`KeyCode::F1`] is used
pub keybind: Option<KeyCode>,
}

Expand Down
1 change: 1 addition & 0 deletions crates/bevy_dev_tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use bevy_app::prelude::*;

#[cfg(feature = "bevy_ci_testing")]
pub mod ci_testing;
/// Module containing logic for FPS overlay.
pub mod fps_overlay;

/// Enables developer tools in an [`App`]. This plugin is added automatically with `bevy_dev_tools`
Expand Down

0 comments on commit 7fe771d

Please sign in to comment.