pub enum CrossfadeState {
Steady,
InProgress {
progress: u8,
},
Settling,
}Expand description
Cross-fade lifecycle state.
Variants§
Steady
No swap in progress.
InProgress
New camera’s pipeline is ramping in over the current one. The
progress value [0, 1] is the new camera’s alpha.
Settling
Crossfade completed — drop old pipeline + sprite slot.
Implementations§
Source§impl CrossfadeState
impl CrossfadeState
Sourcepub fn begin(self) -> Self
pub fn begin(self) -> Self
Begin a crossfade. If already in progress, the current target is replaced with the new target (rapid third-camera click case from the ticket spec).
Sourcepub fn tick(self, elapsed: Duration) -> Self
pub fn tick(self, elapsed: Duration) -> Self
Advance the crossfade by elapsed since the previous tick.
Returns Settling when progress reaches 1.0.
Sourcepub fn is_settling(self) -> bool
pub fn is_settling(self) -> bool
true once the crossfade has reached its target alpha.
Sourcepub fn incoming_alpha(self) -> u8
pub fn incoming_alpha(self) -> u8
Current alpha for the incoming camera (0 in Steady, 255 in Settling). Caller passes this into the wisp scene as the secondary sprite’s alpha multiplier.
Trait Implementations§
Source§impl Clone for CrossfadeState
impl Clone for CrossfadeState
Source§fn clone(&self) -> CrossfadeState
fn clone(&self) -> CrossfadeState
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 moreSource§impl Debug for CrossfadeState
impl Debug for CrossfadeState
Source§impl Default for CrossfadeState
impl Default for CrossfadeState
Source§fn default() -> CrossfadeState
fn default() -> CrossfadeState
Returns the “default value” for a type. Read more
Source§impl PartialEq for CrossfadeState
impl PartialEq for CrossfadeState
Source§fn eq(&self, other: &CrossfadeState) -> bool
fn eq(&self, other: &CrossfadeState) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for CrossfadeState
impl Eq for CrossfadeState
impl StructuralPartialEq for CrossfadeState
Auto Trait Implementations§
impl Freeze for CrossfadeState
impl RefUnwindSafe for CrossfadeState
impl Send for CrossfadeState
impl Sync for CrossfadeState
impl Unpin for CrossfadeState
impl UnsafeUnpin for CrossfadeState
impl UnwindSafe for CrossfadeState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().