diff --git a/examples/basic.rs b/examples/basic.rs index 53734508..7955d1de 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -1,4 +1,4 @@ -use bevy::{prelude::*, render::texture::BevyDefault}; +use bevy::prelude::*; use bevy_ecs_tilemap::prelude::*; mod helpers; @@ -65,9 +65,7 @@ fn startup( array_texture_loader.add(TilemapArrayTexture { texture: TilemapTexture::Single(asset_server.load("tiles.png")), tile_size, - format: BevyDefault::bevy_default(), - tile_spacing: Default::default(), - filter: Default::default(), + ..Default::default() }); } } diff --git a/src/array_texture_preload.rs b/src/array_texture_preload.rs index b9f8d312..fd24a14e 100644 --- a/src/array_texture_preload.rs +++ b/src/array_texture_preload.rs @@ -4,7 +4,10 @@ use crate::{ prelude::{TilemapSpacing, TilemapTileSize}, TilemapTexture, }; -use bevy::render::render_resource::{FilterMode, TextureFormat}; +use bevy::render::{ + render_resource::{FilterMode, TextureFormat}, + texture::BevyDefault, +}; #[cfg(feature = "render")] use bevy::{ prelude::{Assets, Image, Res, ResMut, Resource}, @@ -22,6 +25,18 @@ pub struct TilemapArrayTexture { pub format: TextureFormat, } +impl Default for TilemapArrayTexture { + fn default() -> Self { + Self { + texture: Default::default(), + tile_size: Default::default(), + tile_spacing: Default::default(), + filter: Default::default(), + format: BevyDefault::bevy_default(), + } + } +} + /// A bevy world resource that allows you to add atlas textures for /// loading into the array texture cache. #[derive(Resource, Default, Debug, Clone)]