Crate iyes_progress

source ·
Expand description

Progress Tracking Helper Crate

This crate helps you in cases where you need to track when a bunch of work has been completed, and perform a state transition.

The most typical use case are loading screens, where you might need to load assets, prepare the game world, etc… and then transition to the in-game state when everything is done.

However, this crate is general, and could also be used for any number of other things, even things like cooldowns and animations (especially when used with iyes_loopless to easily have many state types).

Works with either legacy Bevy states (default) or iyes_loopless (via optional cargo feature).

To use this plugin, add one or more instances ProgressPlugin to your App, configuring for the relevant states.

Implement your tasks as regular Bevy systems that return a Progress and add them to your respective state(s) using .track_progress().

The return value indicates how much progress a system has completed so far. It specifies the currently completed “units of work” as well as the expected total.

When all registered systems return a progress value where done >= total, your desired state transition will be performed automatically.

If you need to access the overall progress information (say, to display a progress bar), you can get it from the ProgressCounter resource.


There is also an optional feature (assets) implementing basic asset loading tracking. Just add your handles to the AssetsLoading resource.

If you need something more advanced, I recommend the bevy_asset_loader crate, which now has support for integrating with this crate. :)

Modules

Most used imports

Structs

“Hidden” progress reported by a system.
Progress reported by a system
Resource for tracking overall progress
Add this plugin to your app, to use this crate for the specified state.

Enums

Label to control system execution order

Traits

Trait for all types that can be returned by systems to report progress
Extension trait for systems with progress tracking

Functions

Dummy system to count for a number of frames
Dummy system to wait for a time duration