Minor fix
parent
cb68e9d376
commit
e6512d83fa
|
@ -18,14 +18,14 @@ pub struct UiSprite {
|
||||||
|
|
||||||
impl UiSprite {
|
impl UiSprite {
|
||||||
pub fn from(ct: &Content, ui: &UiSpriteConfig) -> Self {
|
pub fn from(ct: &Content, ui: &UiSpriteConfig) -> Self {
|
||||||
Self::from_with_sprite(ct, ui, ui.sprite.unwrap())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn from_with_sprite(ct: &Content, ui: &UiSpriteConfig, sprite: SpriteHandle) -> Self {
|
|
||||||
if ui.sprite.is_none() {
|
if ui.sprite.is_none() {
|
||||||
unreachable!("called `UiSprite.from()` on a UiSprite with a None sprite!")
|
unreachable!("called `UiSprite.from()` on a UiSprite with a None sprite!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Self::from_with_sprite(ct, ui, ui.sprite.unwrap())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn from_with_sprite(ct: &Content, ui: &UiSpriteConfig, sprite: SpriteHandle) -> Self {
|
||||||
return Self {
|
return Self {
|
||||||
anim: SpriteAutomaton::new(ct, sprite),
|
anim: SpriteAutomaton::new(ct, sprite),
|
||||||
mask: ui.mask,
|
mask: ui.mask,
|
||||||
|
|
Loading…
Reference in New Issue