pub struct ElevatorShakeState { /* private fields */ }Expand description
Frame-driven elevator rumble: scrolls the background up/down by
±pixel_offset, iterations × 2 frames, a rattle cue each iteration,
then a single arrival ding.
Implementations§
Source§impl ElevatorShakeState
impl ElevatorShakeState
pub fn new(params: ElevatorShakeParams) -> Self
pub fn params(&self) -> ElevatorShakeParams
Sourcepub fn total_frames(&self) -> u16
pub fn total_frames(&self) -> u16
Total frames of the shake.
Sourcepub fn tick(&mut self) -> Option<ElevatorShakeSfx>
pub fn tick(&mut self) -> Option<ElevatorShakeSfx>
Advance one frame. Returns ElevatorShakeSfx::Rattle at the start
of each 2-frame iteration and ElevatorShakeSfx::Arrive on the
final frame.
pub fn is_done(&self) -> bool
Trait Implementations§
Source§impl Clone for ElevatorShakeState
impl Clone for ElevatorShakeState
Source§fn clone(&self) -> ElevatorShakeState
fn clone(&self) -> ElevatorShakeState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ElevatorShakeState
Source§impl Debug for ElevatorShakeState
impl Debug for ElevatorShakeState
Source§impl<'de> Deserialize<'de> for ElevatorShakeState
impl<'de> Deserialize<'de> for ElevatorShakeState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ElevatorShakeState
impl RefUnwindSafe for ElevatorShakeState
impl Send for ElevatorShakeState
impl Sync for ElevatorShakeState
impl Unpin for ElevatorShakeState
impl UnsafeUnpin for ElevatorShakeState
impl UnwindSafe for ElevatorShakeState
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