Skip to content

Commit

Permalink
add back infinite grid plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAlban committed Mar 4, 2024
1 parent e6d0506 commit 4e5f716
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Binary file modified demo/.DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ bevy_egui = "0.25.0"
egui = "0.26.2"
egui-gizmo = { path = ".." }

[dependencies.bevy_infinite_grid]
git = "https://github.com/XYCaptain/bevy_infinite_grid.git"
rev = "1e5259a52a7dfaca65402c2c57c1d81c2bc443e9"

[dependencies.bevy_math]
version = "0.12.1"
features = ["mint"]
Expand Down
14 changes: 12 additions & 2 deletions demo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use bevy::render::render_asset::RenderAssetUsages;
use bevy::render::texture::{CompressedImageFormats, ImageFormat, ImageSampler, ImageType};
use bevy::window::PresentMode;
use bevy_egui::{egui, EguiContexts, EguiPlugin};
use bevy_infinite_grid::{InfiniteGridBundle, InfiniteGridPlugin, InfiniteGridSettings};
use egui::color_picker::Alpha;
use egui::{pos2, Align2, Color32, FontId, LayerId, Ui, Widget};

Expand All @@ -29,6 +30,7 @@ fn main() {
}))
.insert_resource(ClearColor(Color::BLACK))
.add_plugins(EguiPlugin)
.add_plugins(InfiniteGridPlugin)
.add_systems(Startup, setup)
.add_systems(Startup, setup_camera)
.add_systems(Update, update)
Expand Down Expand Up @@ -82,14 +84,14 @@ fn setup(

commands.insert_resource(AmbientLight {
color: Color::WHITE,
brightness: 0.2,
brightness: 300.,
});
let cube_handle = meshes.add(Cuboid {
half_size: Vec3::ONE,
});
let cube_material_handle = materials.add(StandardMaterial {
base_color_texture: Some(texture_handle.clone()),
unlit: true,
// unlit: true,
..default()
});

Expand All @@ -102,6 +104,14 @@ fn setup(
..default()
},
));

commands.spawn(InfiniteGridBundle {
settings: InfiniteGridSettings {
shadow_color: None,
..default()
},
..default()
});
}

fn update(
Expand Down

0 comments on commit 4e5f716

Please sign in to comment.