Explain why default_nearest is used in pixel_perfect example (#8370)

# Objective

Fixes #8367 

## Solution

Added a comment explaining why linear filtering is required in this
example, with formatting focused specifically on `ImagePlugin` to avoid
confusion
This commit is contained in:
JohnTheCoolingFan 2023-04-13 20:58:06 +03:00 committed by GitHub
parent 2ec38d1467
commit ff9a178818
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,12 @@ use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()))
.add_plugins(DefaultPlugins.set(
// This sets image filtering to nearest
// This is done to prevent textures with low resolution (e.g. pixel art) from being blurred
// by linear filtering.
ImagePlugin::default_nearest(),
))
.add_systems(Startup, setup)
.add_systems(Update, sprite_movement)
.run();