Struct AnimationState
pub struct AnimationState { /* private fields */ }Expand description
When an animation started (vanilla’s AnimationState): a start tick, or stopped.
Implementations§
§impl AnimationState
impl AnimationState
pub fn new() -> AnimationState
pub fn new() -> AnimationState
new AnimationState(): stopped.
pub fn start_if_stopped(&mut self, tick_count: i32)
pub fn start_if_stopped(&mut self, tick_count: i32)
AnimationState.startIfStopped(tickCount).
pub fn animate_when(&mut self, condition: bool, tick_count: i32)
pub fn animate_when(&mut self, condition: bool, tick_count: i32)
AnimationState.animateWhen(condition, tickCount): started while condition holds,
stopped otherwise.
pub fn stop(&mut self)
pub fn stop(&mut self)
AnimationState.stop().
pub fn fast_forward(&mut self, ticks: i32, speed: f32)
pub fn fast_forward(&mut self, ticks: i32, speed: f32)
AnimationState.fastForward(ticks, speed): a started animation is ticks * speed further.
pub fn time_in_millis(&self, age_in_ticks: f32) -> i64
pub fn time_in_millis(&self, age_in_ticks: f32) -> i64
AnimationState.getTimeInMillis(ageInTicks): how long it has run, 50 ms a tick.
pub fn is_started(&self) -> bool
pub fn is_started(&self) -> bool
AnimationState.isStarted().
Trait Implementations§
§impl Clone for AnimationState
impl Clone for AnimationState
§fn clone(&self) -> AnimationState
fn clone(&self) -> AnimationState
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 AnimationState
§impl Debug for AnimationState
impl Debug for AnimationState
§impl Default for AnimationState
impl Default for AnimationState
§fn default() -> AnimationState
fn default() -> AnimationState
Returns the “default value” for a type. Read more
impl Eq for AnimationState
§impl PartialEq for AnimationState
impl PartialEq for AnimationState
impl StructuralPartialEq for AnimationState
Auto Trait Implementations§
impl Freeze for AnimationState
impl RefUnwindSafe for AnimationState
impl Send for AnimationState
impl Sync for AnimationState
impl Unpin for AnimationState
impl UnsafeUnpin for AnimationState
impl UnwindSafe for AnimationState
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