Struct rusty_spine::Event
source · [−]pub struct Event { /* private fields */ }
Expand description
Events fired from animations.
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
sourceimpl Event
impl Event
pub fn data(&self) -> CTmpRef<'_, Self, EventData>
pub fn data_mut(&mut self) -> CTmpMut<'_, Self, EventData>
pub fn time(&self) -> f32
pub fn int_value(&self) -> i32
pub fn float_value(&self) -> f32
pub fn string_value(&self) -> &str
pub fn volume(&self) -> f32
pub fn balance(&self) -> f32
pub fn c_ptr(&self) -> *mut spEvent
Trait Implementations
sourceimpl NewFromPtr<spEvent> for Event
impl NewFromPtr<spEvent> for Event
unsafe fn new_from_ptr(c_event: *const spEvent) -> Self
Auto Trait Implementations
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more