Skip to content

Commit

Permalink
Update egui example.
Browse files Browse the repository at this point in the history
  • Loading branch information
n3vu0r committed Nov 7, 2023
1 parent b081120 commit b3e1ac3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ c11-orbit = ["trackball/cc"]

[dependencies]
bevy = { version = "0.12.0", default-features = false, features = ["bevy_render"] }
bevy_egui = { version = "0.22.0", default-features = false, optional = true }
bevy_egui = { version = "0.23.0", default-features = false, optional = true }
trackball = { version = "0.11.2", features = ["glam"] }

[dev-dependencies.bevy]
Expand Down
7 changes: 5 additions & 2 deletions examples/egui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ fn render_to_image_example_system(
let ctx = contexts.ctx_mut();
let mut apply = false;
egui::Window::new("Cube material preview").show(ctx, |ui| {
ui.image(cube_preview_texture_id, [300.0, 300.0]);
ui.image(egui::load::SizedTexture::new(
cube_preview_texture_id,
egui::vec2(300.0, 300.0),
));
egui::Grid::new("preview").show(ui, |ui| {
ui.label("Base color:");
color_picker_widget(ui, &mut preview_material.base_color);
Expand Down Expand Up @@ -228,7 +231,7 @@ fn render_to_image_example_system(
let material_clone = preview_material.clone();

let main_material_handle = main_cube_query.single();
let _ = materials.set(main_material_handle, material_clone);
materials.insert(main_material_handle, material_clone);
}
}

Expand Down

0 comments on commit b3e1ac3

Please sign in to comment.