use std::time::Duration; use bevy::prelude::*; use bevy_bsml::prelude::*; #[derive(Debug, Clone, Default, Component)] pub struct LoadingBar; #[derive(Debug, Clone, Component)] pub struct LoadPerc { pub timer: Timer, } impl Default for LoadPerc { fn default() -> Self { Self { timer: Timer::new(Duration::from_secs(5), TimerMode::Once), } } } bsml! {LoadingBar; (node class=[w(300.0), h(30.0), BG_SLATE_400] ) { (node labels=[LoadPerc::default()] class=[w_fract(0.0), H_FULL, BG_BLUE_400] ) } } fn loading_bar_system(mut query: Query<(&mut LoadPerc, &mut BsmlClasses)>, time: Res