From 00f5e36e03b7bf44dbbfbe14a0bdd4639be498a7 Mon Sep 17 00:00:00 2001 From: Lucas Farias Date: Sat, 21 Jun 2025 16:54:46 -0300 Subject: [PATCH] Use linear for foods texture --- examples/usage/control_flow/selection_menu.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/usage/control_flow/selection_menu.rs b/examples/usage/control_flow/selection_menu.rs index 7236ef12bc..545f06b8ba 100644 --- a/examples/usage/control_flow/selection_menu.rs +++ b/examples/usage/control_flow/selection_menu.rs @@ -24,7 +24,10 @@ use bevy::{ spawn::{SpawnIter, SpawnRelated}, system::{Commands, Query, Res, Single}, }, - image::{Image, ImageSamplerDescriptor, TextureAtlas, TextureAtlasLayout}, + image::{ + Image, ImageLoaderSettings, ImageSampler, ImageSamplerDescriptor, TextureAtlas, + TextureAtlasLayout, + }, input::{common_conditions::input_just_pressed, keyboard::KeyCode}, math::{ops, UVec2}, render::{ @@ -738,7 +741,12 @@ where /// Spawn an inventory and fill it with items fn fill_inventory(mut commands: Commands, asset_server: Res) { - let image = asset_server.load("textures/food_kenney.png"); + let image = asset_server.load_with_settings( + "textures/food_kenney.png", + |image_settings: &mut ImageLoaderSettings| { + image_settings.sampler = ImageSampler::linear(); + }, + ); let layout = TextureAtlasLayout::from_grid(UVec2::splat(64), 7, 6, None, None); let layout_handle = asset_server.add(layout);