#progress-bar #bevy-ui #ui #gamedev

bevy-progressbar

Create multi sectons progressbars and use them in the bevy ui

8 releases (5 breaking)

0.7.0 Feb 20, 2024
0.6.1 Nov 16, 2023
0.5.0 Nov 8, 2023
0.4.0 Jul 21, 2023
0.1.1 Feb 1, 2023

#598 in Game dev

Download history 10/week @ 2023-12-04 9/week @ 2023-12-11 163/week @ 2024-02-19 34/week @ 2024-02-26 97/week @ 2024-03-04 23/week @ 2024-03-11 6/week @ 2024-03-18

164 downloads per month

Custom license

30KB
186 lines

Bevy Progressbar

Generate progressbars in bevy ui from simple values. The progressbars can have multiple sections.

Install

cargo add bevy-progressbar

Usage

See examples for better understanding

fn setup(mut commands: Commands, mut materials: ResMut<Assets<ProgressBarMaterial>>) {
    let bar = ProgressBar::new(vec![(1000, Color::RED),(2000, Color::BLUE),(4000, Color::GREEN)]);
    let style = Style {
        position_type: PositionType::Absolute,
        width: Val::Px(400.0),
        height: Val::Px(200.0),
        top: Val::Px(400.0),
        ..bevy_utils::default()
    };
    commands.spawn(
        ProgressBarBundle::new(style, bar, &mut materials);
    );
}
Version Bevy Version
0.2.1 0.9
0.3.0 0.10
0.4.0 0.11
0.5.0 0.12
0.6.0 0.12
0.7.0 0.13

TODO

  • optimize the image creation, by just doing one line and let the gpu use nearst neighbour to scale the texture
  • (optional) render an outline of the progessbar
  • (optional) allow or rounded corners

Dependencies

~41–82MB
~1.5M SLoC