Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Introducing HUD with daybar (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
porkbrain authored Mar 31, 2024
1 parent e49dbc2 commit 4a0225f
Show file tree
Hide file tree
Showing 16 changed files with 236 additions and 86 deletions.
88 changes: 44 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions bevy_magic_light_2d/src/gi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::marker::PhantomData;

use bevy::{
asset::load_internal_asset,
ecs::event::event_update_condition,
prelude::*,
render::{
extract_resource::ExtractResourcePlugin,
Expand Down Expand Up @@ -88,7 +87,7 @@ pub trait LightScene:
app.add_systems(
PreUpdate,
handle_window_resize::<Self>
.run_if(event_update_condition::<WindowResized>)
.run_if(on_event::<WindowResized>())
.after(detect_target_sizes),
);

Expand Down Expand Up @@ -163,8 +162,7 @@ impl bevy::app::Plugin for Plugin {
.add_systems(PreStartup, detect_target_sizes)
.add_systems(
PreUpdate,
detect_target_sizes
.run_if(event_update_condition::<WindowResized>),
detect_target_sizes.run_if(on_event::<WindowResized>()),
);

load_internal_asset!(
Expand Down Expand Up @@ -224,7 +222,7 @@ struct LightPassRenderLabel(&'static str);
/// app.add_systems(
/// PreUpdate,
/// detect_target_sizes
/// .run_if(event_update_condition::<WindowResized>),
/// .run_if(on_event::<WindowResized>),
/// );
/// ```
pub fn detect_target_sizes(
Expand All @@ -250,7 +248,7 @@ pub fn detect_target_sizes(
/// app.add_systems(
/// PreUpdate,
/// handle_window_resize::<YourLightScene>
/// .run_if(event_update_condition::<WindowResized>)
/// .run_if(on_event::<WindowResized>)
/// .after(detect_target_sizes),
/// );
/// ```
Expand Down
Loading

0 comments on commit 4a0225f

Please sign in to comment.