mirror of https://github.com/Leinnan/rpack.git
naming
This commit is contained in:
parent
c7a56c6060
commit
0bd267570c
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ pub trait RpackAssetHelper {
|
|||
key: T,
|
||||
) -> Result<(TextureAtlas, Handle<Image>), RpackAtlasError>;
|
||||
/// Creates a [`Sprite`] component for the given atlas key, if available in any of the loaded Atlases.
|
||||
fn try_make_sprite_from_atlas<T: AsRef<str>>(&self, key: T) -> Result<Sprite, RpackAtlasError>;
|
||||
fn try_make_sprite<T: AsRef<str>>(&self, key: T) -> Result<Sprite, RpackAtlasError>;
|
||||
/// Creates a [`ImageNode`] component for the given atlas key, if available in any of the loaded Atlases.
|
||||
fn try_make_image_node_from_atlas<T: AsRef<str>>(
|
||||
fn try_make_image_node<T: AsRef<str>>(
|
||||
&self,
|
||||
key: T,
|
||||
) -> Result<ImageNode, RpackAtlasError>;
|
||||
|
|
@ -79,7 +79,7 @@ impl RpackAssetHelper for Assets<RpackAtlasAsset> {
|
|||
Err(RpackAtlasError::WrongKey)
|
||||
}
|
||||
|
||||
fn try_make_sprite_from_atlas<T: AsRef<str>>(&self, key: T) -> Result<Sprite, RpackAtlasError> {
|
||||
fn try_make_sprite<T: AsRef<str>>(&self, key: T) -> Result<Sprite, RpackAtlasError> {
|
||||
if self.is_empty() {
|
||||
return Err(RpackAtlasError::NoAtlas);
|
||||
}
|
||||
|
|
@ -91,7 +91,7 @@ impl RpackAssetHelper for Assets<RpackAtlasAsset> {
|
|||
Err(RpackAtlasError::WrongKey)
|
||||
}
|
||||
|
||||
fn try_make_image_node_from_atlas<T: AsRef<str>>(
|
||||
fn try_make_image_node<T: AsRef<str>>(
|
||||
&self,
|
||||
key: T,
|
||||
) -> Result<ImageNode, RpackAtlasError> {
|
||||
|
|
|
|||
Loading…
Reference in New Issue