Skip to main content

SsEventData

Struct SsEventData 

Source
#[repr(C)]
pub struct SsEventData {
Show 16 fields pub kind: u32, pub part_index: u32, pub frame_no: u32, pub source: u32, pub has_integer: bool, pub has_rect: bool, pub has_point: bool, pub has_text: bool, pub integer: i32, pub rect: [f32; 4], pub point: [f32; 2], pub text: *const c_char, pub param_count: u32, pub sound_list_name_hash: u32, pub sound_name_hash: u32, pub loop_num: i32,
}
Expand description

One timeline event, flattened for the ABI.

The three kinds share one struct rather than a real union, because a union across the ABI costs the caller a cast for no gain at this size. kind says which fields carry anything; the rest are zeroed.

text is owned by the scene and valid until the next ss_player_event_at on it — copy it if you need to keep it. Never null.

Fields§

§kind: u32

One of the SS_EVENT_* constants.

§part_index: u32

Which part raised it.

§frame_no: u32

The frame the key is authored on, which is not necessarily the frame the tick landed on: one update can step across several frames and reports every key in between, so this is the only way to tell them apart.

§source: u32

The source on the track stack that fired it, as ss_player_track_main_source and ss_player_add_track_source name it. By default only track 0’s main source fires; this tells events apart once another source has opted in with ss_player_set_source_event_threshold.

§has_integer: bool

UserData: whether the animator filled each optional field in. Unset is not the same as zero, which is what these distinguish.

§has_rect: bool§has_point: bool§has_text: bool§integer: i32

UserData, when has_integer.

§rect: [f32; 4]

UserData, when has_rect: [left, top, right, bottom] — four edges, not origin+size.

§point: [f32; 2]

UserData, when has_point.

§text: *const c_char

UserData’s str (when has_text), Signal’s command_id, or Audio’s sound_name. Empty for the kinds that have none.

§param_count: u32

Signal: how many parameters ss_player_event_signal_param_at will serve.

§sound_list_name_hash: u32

Audio: addresses the SoundList and the SoundFile within it.

§sound_name_hash: u32§loop_num: i32

Audio: how many times to play. A count, never zero — SpriteStudio has no infinite audio loop.

Trait Implementations§

Source§

impl Clone for SsEventData

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SsEventData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more