bevy_ratepace

bevy_ratepace is a crate to configure the update frequency of headless bevy

2 unstable releases

0.14.0 Sep 17, 2024
0.13.0 Sep 11, 2024

#61 in Simulation

Download history 78/week @ 2024-09-05 190/week @ 2024-09-12 38/week @ 2024-09-19 12/week @ 2024-09-26 4/week @ 2024-10-03 3/week @ 2024-10-10

93 downloads per month
Used in matks

MIT license

7KB
108 lines

stable pipeline docs crates.io

bevy_ratepace

bevy_ratepace is a crate to configure the update frequency of headless bevy. The code is based on https://github.com/aevyrie/bevy_framepace.

How to use

Add to your project with:

cargo add bevy_ratepace

Add bevy_ratepace as a plugin:

use bevy::prelude::*;

fn set_frame_rate(mut settings: ResMut<bevy_ratepace::RatepaceSettings>)
{
    settings.limiter = bevy_ratepace::Limiter::from_framerate(10.0);
}

fn main()
{
    App::new()
        .add_systems(
            Startup,
            (
                set_frame_rate,
            ),
        )
        .add_plugins((bevy_ratepace::RatepacePlugin));
}

Dependencies

~18–29MB
~455K SLoC