Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to bevy 0.11 #6

Closed
Zheoni opened this issue Jul 10, 2023 · 1 comment
Closed

Update to bevy 0.11 #6

Zheoni opened this issue Jul 10, 2023 · 1 comment

Comments

@Zheoni
Copy link
Owner

Zheoni commented Jul 10, 2023

I have mostly finished the update, just waiting for bevy_egui to update.

vladbat00/bevy_egui#189 and/or vladbat00/bevy_egui#188

@Zheoni
Copy link
Owner Author

Zheoni commented Jul 11, 2023

I need to fix this test and it should be ready. But currently I don't know how.

fn do_resize_sprite() {
let mut app = App::new();
app.add_plugins(MinimalPlugins)
.add_plugins(bevy::asset::AssetPlugin::default())
.add_plugins(bevy::render::texture::ImagePlugin::default())
.add_plugins(bevy::window::WindowPlugin::default())
.add_plugins(bevy::sprite::SpritePlugin::default())
.add_plugins(bevy::render::RenderPlugin::default());
app.add_systems(Update, sprite_custom_size);
let set_size = UVec2::new(10, 10);
let mut images = app.world.resource_mut::<Assets<Image>>();
let image = images.add(create_image(set_size.into()));
let pb_id = app
.world
.spawn(PixelBufferSpriteBundle {
pixel_buffer: PixelBuffer {
size: PixelBufferSize::size(set_size),
fill: Fill::none(),
},
sprite_bundle: SpriteBundle {
sprite: Sprite {
custom_size: None,
..Default::default()
},
texture: image,
..Default::default()
},
})
.id();
app.update();
let size = app.world.get::<PixelBuffer>(pb_id).unwrap().size;
let sprite = app.world.get::<Sprite>(pb_id).unwrap();
assert!(sprite.custom_size.is_some());
assert_eq!(size.screen_size(), sprite.custom_size.unwrap().as_uvec2());
}

@Zheoni Zheoni closed this as completed Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant