From 8fb00222803bed039fe80edbbbf28adab3036319 Mon Sep 17 00:00:00 2001 From: Franz Dietrich Date: Sun, 3 Sep 2023 22:57:51 +0200 Subject: [PATCH] fix the testcases --- src/bin/bevy_egui_test.rs | 23 ++++++++++++++++------- src/bin/circle.rs | 17 ++++++++++++----- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/bin/bevy_egui_test.rs b/src/bin/bevy_egui_test.rs index e8d01ea..b2fef16 100644 --- a/src/bin/bevy_egui_test.rs +++ b/src/bin/bevy_egui_test.rs @@ -1,6 +1,8 @@ use bevy::{app::AppExit, prelude::*}; use bevy_egui::{egui, EguiContexts, EguiPlugin}; -use bevy_prototype_lyon::prelude::{Fill, GeometryBuilder, Path, PathBuilder, ShapePlugin, Stroke}; +use bevy_prototype_lyon::prelude::{ + Fill, GeometryBuilder, Path, PathBuilder, ShapeBundle, ShapePlugin, Stroke, +}; #[derive(Default, Resource)] struct OccupiedScreenSpace { @@ -31,12 +33,12 @@ fn main() { }), ..default() })) - .add_plugin(EguiPlugin) - .add_plugin(ShapePlugin) + .add_plugins(EguiPlugin) + .add_plugins(ShapePlugin) .init_resource::() - .add_startup_system(setup_system) - .add_system(ui) - .add_system(update_path) + .add_systems(Startup, setup_system) + .add_systems(Update, ui) + .add_systems(Update, update_path) .run(); } @@ -99,5 +101,12 @@ fn setup_system(mut commands: Commands) { let fill = Fill::color(Color::MIDNIGHT_BLUE); let stroke = Stroke::color(Color::BLACK); - commands.spawn((GeometryBuilder::build_as(&line), fill, stroke)); + commands.spawn(( + ShapeBundle { + path: GeometryBuilder::build_as(&line), + ..default() + }, + fill, + stroke, + )); } diff --git a/src/bin/circle.rs b/src/bin/circle.rs index 17c2315..afaba05 100644 --- a/src/bin/circle.rs +++ b/src/bin/circle.rs @@ -10,10 +10,10 @@ fn main() { App::new() .insert_resource(Msaa::Sample4) .add_plugins(DefaultPlugins) - .add_plugin(ShapePlugin) - .add_plugin(TweeningPlugin) - .add_startup_system(setup_system) - .add_system(component_animator_system::) + .add_plugins(ShapePlugin) + .add_plugins(TweeningPlugin) + .add_systems(Startup, setup_system) + .add_systems(Update, component_animator_system::) .run(); } @@ -67,7 +67,14 @@ fn setup_system(mut commands: Commands) { let fill = Fill::color(Color::MIDNIGHT_BLUE); let stroke = Stroke::color(Color::BLACK); commands - .spawn((GeometryBuilder::build_as(&line), fill, stroke)) + .spawn(( + ShapeBundle { + path: GeometryBuilder::build_as(&line), + ..default() + }, + fill, + stroke, + )) .insert(animator); }