pub struct Event { /* private fields */ }
Expand description

Events fired from animations.

Spine API Reference

To receive events, set a listener on AnimationState

animation_state.set_listener(|animation_state, event_type, track_entry, event| {
    match event_type {
        EventType::Start => {
            println!("Animation started!");
        }
        EventType::Interrupt => {
            println!("Animation interrupted!");
        }
        EventType::End => {
            println!("Animation ended!");
        }
        EventType::Complete => {
            println!("Animation completed!");
        }
        EventType::Dispose => {
            println!("Animation disposed!");
        }
        EventType::Event => {
            println!("Animation event!");
            if let Some(event) = event {
                println!("  Event name: {}", event.data().name());
            }
        }
        _ => {}
    }
});

Implementations

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.