pub struct Timeline { /* private fields */ }Expand description
When each shot of a cinematic starts, and when the cinematic ends.
Implementations§
Source§impl Timeline
impl Timeline
Sourcepub fn new(starts_ms: Vec<u32>, length_ms: u32) -> Self
pub fn new(starts_ms: Vec<u32>, length_ms: u32) -> Self
A timeline of shots starting at starts_ms (in order, the first at
0, as a loaded cinematic has them) over length_ms (0 counts as 1).
Sourcepub fn of<S>(def: &CinematicDef<S>) -> Self
pub fn of<S>(def: &CinematicDef<S>) -> Self
The timeline of def’s shots.
Sourcepub fn last_start_ms(&self) -> u32
pub fn last_start_ms(&self) -> u32
When the last shot starts, in milliseconds (0 with no shots).
Sourcepub fn in_last_shot(&self, t_ms: u64) -> bool
pub fn in_last_shot(&self, t_ms: u64) -> bool
Whether t_ms (wrapped at the length) falls in the last shot.
Sourcepub fn shot_ms(&self, index: usize) -> u32
pub fn shot_ms(&self, index: usize) -> u32
How long shot index lasts, in milliseconds: until the next one
starts, the last until the end. 0 for a shot there isn’t.
Sourcepub fn wrapped_ms(&self, t_ms: u64) -> u32
pub fn wrapped_ms(&self, t_ms: u64) -> u32
t_ms wrapped at the length: the cinematic loops.
Sourcepub fn at_ms(&self, t_ms: u64) -> ShotAt
pub fn at_ms(&self, t_ms: u64) -> ShotAt
The shot t_ms milliseconds after the start falls in, wrapped at
the length. A shot lasts until the next one starts, the last until
the end; time before the first shot’s start is the first shot’s.
Trait Implementations§
impl Eq for Timeline
impl StructuralPartialEq for Timeline
Auto Trait Implementations§
impl Freeze for Timeline
impl RefUnwindSafe for Timeline
impl Send for Timeline
impl Sync for Timeline
impl Unpin for Timeline
impl UnsafeUnpin for Timeline
impl UnwindSafe for Timeline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more