#[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: u32One of the SS_EVENT_* constants.
part_index: u32Which part raised it.
frame_no: u32The 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: u32The 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: boolUserData: 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: i32UserData, 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_charUserData’s str (when has_text), Signal’s command_id, or Audio’s
sound_name. Empty for the kinds that have none.
param_count: u32Signal: how many parameters ss_player_event_signal_param_at will serve.
sound_list_name_hash: u32Audio: addresses the SoundList and the SoundFile within it.
sound_name_hash: u32§loop_num: i32Audio: how many times to play. A count, never zero — SpriteStudio has no infinite audio loop.