Enum bevy_tweening::TweeningDirection
source · pub enum TweeningDirection {
Forward,
Backward,
}
Expand description
Direction a tweening animation is playing.
When playing a tweenable forward, the progress values 0
and 1
are
respectively mapped to the start and end bounds of the lens(es) being used.
Conversely, when playing backward, this mapping is reversed, such that a
progress value of 0
corresponds to the state of the target at the end
bound of the lens, while a progress value of 1
corresponds to the state of
that target at the start bound of the lens, effectively making the animation
play backward.
For all but RepeatStrategy::MirroredRepeat
this is always
TweeningDirection::Forward
, unless manually configured with
Tween::set_direction()
in which case the value is constant equal to the
value set. When using RepeatStrategy::MirroredRepeat
, this is either
forward (from start to end; ping) or backward (from end to start; pong),
depending on the current iteration of the loop.
Variants§
Forward
Animation playing from start to end.
Backward
Animation playing from end to start, in reverse.
Implementations§
source§impl TweeningDirection
impl TweeningDirection
sourcepub fn is_forward(&self) -> bool
pub fn is_forward(&self) -> bool
Is the direction equal to TweeningDirection::Forward
?
sourcepub fn is_backward(&self) -> bool
pub fn is_backward(&self) -> bool
Is the direction equal to TweeningDirection::Backward
?
Trait Implementations§
source§impl Clone for TweeningDirection
impl Clone for TweeningDirection
source§fn clone(&self) -> TweeningDirection
fn clone(&self) -> TweeningDirection
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TweeningDirection
impl Debug for TweeningDirection
source§impl Default for TweeningDirection
impl Default for TweeningDirection
source§impl Not for TweeningDirection
impl Not for TweeningDirection
source§impl PartialEq for TweeningDirection
impl PartialEq for TweeningDirection
source§fn eq(&self, other: &TweeningDirection) -> bool
fn eq(&self, other: &TweeningDirection) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for TweeningDirection
impl Eq for TweeningDirection
impl StructuralPartialEq for TweeningDirection
Auto Trait Implementations§
impl RefUnwindSafe for TweeningDirection
impl Send for TweeningDirection
impl Sync for TweeningDirection
impl Unpin for TweeningDirection
impl UnwindSafe for TweeningDirection
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
[ShaderType
] for self
. When used in [AsBindGroup
]
derives, it is safe to assume that all images in self
exist.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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DynEq for T
impl<T> DynEq for T
§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
§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
key
and return true
if they are equal.§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given [World
].