Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds update interval config for FpsOverlayPlugin #17489

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

spvky
Copy link
Contributor

@spvky spvky commented Jan 22, 2025

Objective

Fixes #17487

  • Adds a new field refresh_interval to FpsOverlayConfig to allow the user setting a minimum time before each refresh of the FPS display

Solution

  • Add refresh_interval to FpsOverlayConfig
  • When updating the on screen text, check a duration of refresh_interval has passed, if not, don't update the FPS counter

Testing

  • Created a new bevy project
  • Included the FpsOverlayPlugin with the default refresh_interval (100 ms)
  • Included the FpsOverlayPlugin with an obnoxious refresh_interval (2 seconds)

…g the amount of time to wait before re-rending the fps counter
@spvky spvky changed the title Adds a refresh-interval field to FpsOverlayConfig to allow controllin… Add update interval config for FpsOverlayPlugin Jan 22, 2025
@spvky spvky changed the title Add update interval config for FpsOverlayPlugin Adds update interval config for FpsOverlayPlugin Jan 22, 2025
@BenjaminBrienen BenjaminBrienen added C-Feature A new feature, making something new possible A-Dev-Tools Tools used to debug Bevy applications. D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jan 22, 2025
@BenjaminBrienen BenjaminBrienen added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jan 22, 2025
@@ -110,11 +116,19 @@ fn update_text(
diagnostic: Res<DiagnosticsStore>,
query: Query<Entity, With<FpsText>>,
mut writer: TextUiWriter,
//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Dev-Tools Tools used to debug Bevy applications. C-Feature A new feature, making something new possible D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add update interval config for FpsOverlayPlugin
2 participants