Crates.io | bevy_ratepace |
lib.rs | bevy_ratepace |
version | 0.14.0 |
source | src |
created_at | 2024-09-11 08:36:17.877667 |
updated_at | 2024-09-17 11:08:52.56382 |
description | `bevy_ratepace` is a crate to configure the update frequency of headless bevy. |
homepage | |
repository | https://gitlab.com/cyloncore/bevy_ratepace |
max_upload_size | |
id | 1371686 |
size | 7,144 |
bevy_ratepace
is a crate to configure the update frequency of headless bevy. The code is based on https://github.com/aevyrie/bevy_framepace.
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));
}