[][src]Trait polyhorn_ui::animation::Animatable

pub trait Animatable {
    type Animator: Animator;
    type CommandBuffer;
    pub fn animate<F>(&mut self, animations: F)
    where
        F: FnOnce(&mut Self::Animator) + Send + 'static
;
pub fn animate_with_buffer<F>(
        &mut self,
        buffer: &mut Self::CommandBuffer,
        animations: F
    )
    where
        F: FnOnce(&mut Self::Animator) + Send + 'static
; }

This trait is implemented by types that can be animated.

Associated Types

type Animator: Animator[src]

This is the type that can schedule new animations for this object.

type CommandBuffer[src]

This is the command buffer that this object can piggy-back on.

Loading content...

Required methods

pub fn animate<F>(&mut self, animations: F) where
    F: FnOnce(&mut Self::Animator) + Send + 'static, 
[src]

This function should invoke the given callback with a mutable reference to (a new instance of) this object's animator.

pub fn animate_with_buffer<F>(
    &mut self,
    buffer: &mut Self::CommandBuffer,
    animations: F
) where
    F: FnOnce(&mut Self::Animator) + Send + 'static, 
[src]

This function should invoke the given callback with a mutable reference to (a new instance of) this object's animator that piggy-backs on the given command buffer. Explicitly passing a command buffer ensures that the animations are started in the same UI event loop iteration as the current render itself.

Loading content...

Implementors

Loading content...