Skip to main content

queue_custom_animation

Function queue_custom_animation 

Source
pub fn queue_custom_animation<F>(
    callback: F,
    duration_seconds: f32,
) -> Option<u32>
where F: FnMut(u32, f32, f32) + 'static,
Expand description

Queue a custom per-frame animation with a callback.

callback receives (animation_id, dt, elapsed_seconds) every frame. The compositor automatically removes the animation after duration_seconds.

dt and elapsed_seconds are floats in seconds.

Returns the host-generated animation ID on success, or None on error.