diff --git a/src/animation.rs b/src/animation.rs index d5704bf..e3e13af 100644 --- a/src/animation.rs +++ b/src/animation.rs @@ -53,7 +53,14 @@ impl AnimationActor for AnimatedSurface { } impl Animation { - pub fn from(self, from: u8) -> Self { + pub const fn new() -> Self { + Self { + from: None, + to: None, + duration: Duration::from_ticks(0) + } + } + pub const fn from(self, from: u8) -> Self { Self { from: Some(from), to: self.to, @@ -61,7 +68,7 @@ impl Animation { } } - pub fn to(self, to: u8) -> Self { + pub const fn to(self, to: u8) -> Self { Self { from: self.from, to: Some(to), @@ -69,7 +76,7 @@ impl Animation { } } - pub fn duration(self, duration: Duration) -> Self { + pub const fn duration(self, duration: Duration) -> Self { Self { from: self.from, to: self.to,