pub struct Animator(/* private fields */);
Implementations§
Source§impl Animator
impl Animator
pub fn new() -> Animator
pub fn set_start_cb(&self, trigger_cb: impl FnMut() + 'static)
Sourcepub fn start(&self, animation: impl HistPrimAnimation + 'static)
pub fn start(&self, animation: impl HistPrimAnimation + 'static)
Start a new animation for the primitive, replacing any existing animation.
Sourcepub fn cancel<T: PartialEq + Clone + 'static>(&self, prim: &HistPrim<T>)
pub fn cancel<T: PartialEq + Clone + 'static>(&self, prim: &HistPrim<T>)
Stop easing a primitive. If the primitive isn’t being smoothed this does nothing. The primitive will retain the current value.
Sourcepub fn update(&self, eg: &EventGraph, delta_ms: f64) -> bool
pub fn update(&self, eg: &EventGraph, delta_ms: f64) -> bool
Updates interpolating nodes and processes the graph as usual. Call from
requestAnimationFrame
for example, in a WASM context. Returns true as long as
there are animations to continue.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Animator
impl !RefUnwindSafe for Animator
impl !Send for Animator
impl !Sync for Animator
impl Unpin for Animator
impl !UnwindSafe for Animator
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