Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Update example to use new `ImagePlugin` setup for nearest rendering.

See the original PR bevyengine/bevy#6360
  • Loading branch information
cscorley committed Dec 9, 2022
1 parent fe864df commit b374dfa
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions README.md
Expand Up @@ -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()))
...
```

Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit b374dfa

Please sign in to comment.