diff --git a/crates/bevy_rpack/README.md b/crates/bevy_rpack/README.md index 0f6010c..8fa9b94 100644 --- a/crates/bevy_rpack/README.md +++ b/crates/bevy_rpack/README.md @@ -37,13 +37,13 @@ fn on_loaded( continue; }; - if let Ok(sprite) = assets.try_make_sprite_from_atlas("agents/spaceAstronauts_005") { + if let Ok(sprite) = assets.try_make_sprite("agents/spaceAstronauts_005") { commands.spawn(Sprite { color: Color::linear_rgb(1.0, 0.0, 0.0), ..sprite }); }; - if let Ok(image_node) = assets.try_make_image_node_from_atlas("agents/spaceShips_006") { + if let Ok(image_node) = assets.try_make_image_node("agents/spaceShips_006") { commands.spawn(image_node); } } diff --git a/crates/bevy_rpack/examples/simple.rs b/crates/bevy_rpack/examples/simple.rs index 5c44af6..f5de204 100644 --- a/crates/bevy_rpack/examples/simple.rs +++ b/crates/bevy_rpack/examples/simple.rs @@ -30,13 +30,13 @@ fn on_loaded( continue; }; - if let Ok(sprite) = assets.try_make_sprite_from_atlas("agents/spaceAstronauts_005") { + if let Ok(sprite) = assets.try_make_sprite("agents/spaceAstronauts_005") { commands.spawn(Sprite { color: Color::linear_rgb(1.0, 0.0, 0.0), ..sprite }); }; - if let Ok(image_node) = assets.try_make_image_node_from_atlas("agents/spaceShips_006") { + if let Ok(image_node) = assets.try_make_image_node("agents/spaceShips_006") { commands.spawn(image_node); } } diff --git a/crates/bevy_rpack/src/plugin.rs b/crates/bevy_rpack/src/plugin.rs index 1b69151..878470d 100644 --- a/crates/bevy_rpack/src/plugin.rs +++ b/crates/bevy_rpack/src/plugin.rs @@ -47,9 +47,9 @@ pub trait RpackAssetHelper { key: T, ) -> Result<(TextureAtlas, Handle), RpackAtlasError>; /// Creates a [`Sprite`] component for the given atlas key, if available in any of the loaded Atlases. - fn try_make_sprite_from_atlas>(&self, key: T) -> Result; + fn try_make_sprite>(&self, key: T) -> Result; /// Creates a [`ImageNode`] component for the given atlas key, if available in any of the loaded Atlases. - fn try_make_image_node_from_atlas>( + fn try_make_image_node>( &self, key: T, ) -> Result; @@ -79,7 +79,7 @@ impl RpackAssetHelper for Assets { Err(RpackAtlasError::WrongKey) } - fn try_make_sprite_from_atlas>(&self, key: T) -> Result { + fn try_make_sprite>(&self, key: T) -> Result { if self.is_empty() { return Err(RpackAtlasError::NoAtlas); } @@ -91,7 +91,7 @@ impl RpackAssetHelper for Assets { Err(RpackAtlasError::WrongKey) } - fn try_make_image_node_from_atlas>( + fn try_make_image_node>( &self, key: T, ) -> Result {