From b374dfabaf312f9ba0b348e9a820e39c441dcf4a Mon Sep 17 00:00:00 2001 From: Christopher Corley Date: Fri, 9 Dec 2022 18:29:31 -0500 Subject: [PATCH] Update README.md Update example to use new `ImagePlugin` setup for nearest rendering. See the original PR https://github.com/bevyengine/bevy/pull/6360 --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4120190..5e1764d 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,11 @@ by 2, you need to change the anchor of the sprite (which is at the center by default), or it will not be pixel aligned. Also note that Bevy uses linear sampling by default for textures, which is -not what you want for pixel art. The easiest way to change this is to insert the -following resource on you app: +not what you want for pixel art. The easiest way to change this is to set the +default_sampler on the ImagePlugin: ```rust App::new() - .insert_resource(bevy::render::texture::ImageSettings::default_nearest()) + .add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest())) ... ``` @@ -59,8 +59,7 @@ use bevy_pixel_camera::{ fn main() { App::new() - .insert_resource(bevy::render::texture::ImageSettings::default_nearest()) - .add_plugins(DefaultPlugins) + .add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest())) .add_plugin(PixelCameraPlugin) .add_plugin(PixelBorderPlugin { color: Color::rgb(0.1, 0.1, 0.1),