pub struct SequenceBuilder { /* private fields */ }Expand description
Builder for an AnimationSequence. Steps play in the order they are
added; build rejects authoring errors.
Implementations§
Source§impl SequenceBuilder
impl SequenceBuilder
Sourcepub fn loop_mode(self, loop_mode: SequenceLoop) -> Self
pub fn loop_mode(self, loop_mode: SequenceLoop) -> Self
Set the loop mode (default SequenceLoop::Once).
Sourcepub fn play_frames(
self,
frames: impl Into<Vec<usize>>,
frame_duration: f32,
) -> Self
pub fn play_frames( self, frames: impl Into<Vec<usize>>, frame_duration: f32, ) -> Self
Play an explicit frame order, holding each frame for frame_duration
seconds.
Sourcepub fn play_frame_range(
self,
first: usize,
last: usize,
frame_duration: f32,
) -> Self
pub fn play_frame_range( self, first: usize, last: usize, frame_duration: f32, ) -> Self
Play the inclusive frame range first..=last.
Sourcepub fn random_pause(self, min: f32, max: f32) -> Self
pub fn random_pause(self, min: f32, max: f32) -> Self
Hold for a duration in [min, max] when the step is entered;
floating-point rounding can reach max.
Sourcepub fn build(self) -> Result<AnimationSequence, SequenceError>
pub fn build(self) -> Result<AnimationSequence, SequenceError>
Validate and build. An empty step list, an empty PlayFrames step, and
a negative or NaN duration are authoring errors, not runtime states.
Trait Implementations§
Source§impl Clone for SequenceBuilder
impl Clone for SequenceBuilder
Source§impl Debug for SequenceBuilder
impl Debug for SequenceBuilder
Auto Trait Implementations§
impl Freeze for SequenceBuilder
impl RefUnwindSafe for SequenceBuilder
impl Send for SequenceBuilder
impl Sync for SequenceBuilder
impl Unpin for SequenceBuilder
impl UnsafeUnpin for SequenceBuilder
impl UnwindSafe for SequenceBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more