Skip to content

Commit b374dfa

Browse files
authored
Update README.md
Update example to use new `ImagePlugin` setup for nearest rendering. See the original PR bevyengine/bevy#6360
1 parent fe864df commit b374dfa

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ by 2, you need to change the anchor of the sprite (which is at the center by
1818
default), or it will not be pixel aligned.
1919

2020
Also note that Bevy uses linear sampling by default for textures, which is
21-
not what you want for pixel art. The easiest way to change this is to insert the
22-
following resource on you app:
21+
not what you want for pixel art. The easiest way to change this is to set the
22+
default_sampler on the ImagePlugin:
2323
```rust
2424
App::new()
25-
.insert_resource(bevy::render::texture::ImageSettings::default_nearest())
25+
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
2626
...
2727
```
2828

@@ -59,8 +59,7 @@ use bevy_pixel_camera::{
5959

6060
fn main() {
6161
App::new()
62-
.insert_resource(bevy::render::texture::ImageSettings::default_nearest())
63-
.add_plugins(DefaultPlugins)
62+
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
6463
.add_plugin(PixelCameraPlugin)
6564
.add_plugin(PixelBorderPlugin {
6665
color: Color::rgb(0.1, 0.1, 0.1),

0 commit comments

Comments
 (0)